Virtual member manager is configured to use the dynamic model. You can create new property types and add them to existing virtual member manager built-in entity types dynamically at runtime.
You need to call the virtual member manager createSchema API to create new property types and add them to existing virtual member manager built-in entity types at runtime without restarting virtual member manager. Out-of-the-box, both the LDAP Adapter and the DB Adapter supports this type of procedure. For this example you want to create a new property type called postOfficeBox and add this property type to the virtual member manager built-in entity type PersonAccount. This example uses the LDAP Adapter.
Perform the following:
If underlying adapters include DB Adapter, no extra preparation is needed.
<?xml version="1.0" encoding="UTF-8"?> <sdo:datagraph xmlns:sdo="commonj.sdo" xmlns:wim="http://www.ibm.com/websphere/wim"> <wim:schema> <wim:propertySchema dataType="STRING" multiValued="true" propertyName="postOfficeBox" valueLength="40"> <wim:applicableEntityTypeNames>PersonAccount</wim:applicableEntityTypeNames> </wim:propertySchema> </wim:schema> </sdo:datagraph>
On the client side, the exploiting virtual member manager application calls the virtual member manager createSchema API through the Local Service Provider. Local Service Provider detects that this call changes the schema and updates the local schema (ECore) after the createSchema API call is finished.
On the server side, the Schema Manager receives the API call from client. The Schema Manager first checks if the new property types already exist and throws an exception if they do. Then the Schema Manager updates the ECore model in memory to add new entity types to existing entity types. In this sample, the EClass of PersonAccount is added a new EAttribute called postOfficeBox.
<wim:propertySchema dataType="STRING" multiValued="true" propertyName="postOfficeBox" valueLength="40"> <wim:applicableEntityTypeNames>PersonAccount</wim:applicableEntityTypeNames> </wim:propertySchema>The Schema Manager calls the Repository Manager which in turn calls the createSchema SPI method of all the adapters.
If one or more repository adapters throws the OperationNotSupportedException when creating new properties from the createSchema SPI, the Schema Manager calls the Property Extension Adapter to create this property in the Property Extension database. If a Property Extension Adapter is not configured, virtual member manager throws the exception to the exploiting application.
If at least one repository adapter supports creating new entities and does not throw the OperationNotSupportedException, virtual member manager returns the repository IDs of these repositories in the output data graph.
At client side, after the createSchema API call is returned, the Local Service Provider calls the getEPackages API to retrieve the latest schemas. The Local Service Provider reregisters the schemas in the client JVM. Exploiting applications can call the virtual member manager create API to create a new entity of type PersonAccount with property postOfficeBox. Virtual member manager does not need to restart for the schema change to become active.