Express (Distributed operating systems), v8.0 > Secure applications and their environment > Authenticate users > Select a registry or repository > Manage realms in a federated repository > Virtual member manager > Develop with virtual member manager > Extend virtual member manager functionality in the application
Static model schema loading process
We can add new entity types, property types and control types into extension schema XSD files such as wimextension.xsd. These XSD files import the virtual member manager built-in schema XSD files. We can then generate the static model code from the extension schema XSD files through Eclipse or RAD development environment or similar tools. The generated mode code is compressed into jar files (for example, wimmodel.jar and wimmodelext.jar) and put under the class path.
When virtual member manager starts, the Configuration Manager loads the wimconfig.xml file into configuration data graph. The Schema Manager is then passed with configuration data graph.
The Schema Manager gets the fully qualified names of the package interfaces, com.ibm.websphere.wim.model.ModelPackage and com.ibm.websphere.wim.model.ext.ExtPackage from the data object staticModel and registers these static packages. The Schema Manager reads the wimxmlextension.xml file to retrieve the additional dynamic schema information and makes the following changes:
- If the entity types or property types are already defined in the XSD files, virtual member manager throws an initialization exception even if they are not defined in the same namespace.
- If the entity or property types belong to a different namespace other than the existing ones, Schema Manager creates a new ECore model (EPackge) and adds the schema of these types into the Ecore model. For example, if the entity type, ContactPerson is defined under a new namespace URI ( //publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=/ ://www.yourco.com/yourext ), a new ECore model is created.
- If the entity or property type belongs to existing namespaces of a static package, these schema definitions are ignored because the static packages cannot be modified at runtime.
If the instance of the Local Service Provider is in the same Java Virtual Machine (JVM) as the virtual member manager instance, the process is complete because the ECore models are already registered by Schema Manager.
If the instance of the Local Service Provider is not in the same JVM as the virtual member manager instance, an instance of Local Service Provider is created remotely, the Local Service Provider calls the virtual member manager API getEPackges to retrieve the schemas of all namespaces by passing the nsURI parameter as null.
The Profile Manager receives the API call and passes it to Schema Manager. Because the ECore models are not serialized and cannot be passed to the remote client, the Schema Manager converts the ECore models into the form of a byte array and passes the schemas back to the Local Service Provider.
The Local Service Provider converts the schemas from byte array to ECore models and registers them in the client's JVM.
If client and server are in the same JVM, the client can cast the data objects defined in static packages to their static types and use static methods. For example, a data object of PersonAccount can be cast to the PersonAccount object and the static method like getSn can be used (instead of the static method like getString(“sn”). These don't apply to data objects (e.g. ContactPerson) defined in wimxmlextension.xml, which are dynamic packages.
If client and server are in the different JVM, static types and methods cannot be used even for the data objects defined in static packages because the static packages cannot be accessed in the JVM of the client.
- Static model: creating new entities and properties at deployment time
Virtual member manager is configured to use static model. We can create new entity types and their associated new property types at deployment time.- Static model: adding new controls at deployment time
Virtual member manager is configured to use the static model. We can create control types at deployment time.
Parent topic: Extend virtual member manager functionality in the application