Out of the box adapters for federated repositories provide File, LDAP, and Database
adapter for your use. These adapters implement the com.ibm.wsspi.wim.Repository software programming
interface (SPI). Custom adapters for federated repositories need to implement the same
SPI.
Before you begin
Refer to the Repository SPI implementation information in the related references for information
about the custom adapters for federated repositories SPI.
Refer to the sample custom adapter code that is available in the
vmmsampleadapter.jar file. The JAR file contains the sample customer adapter
code in the
src/ directory. The
vmmsampleadapter.jar can
be downloaded at this location:
http://www.ibm.com/developerworks/websphere/library/samples/vmmsampleadapter.htmlNote: - The sample that is provided is intended to familiarize you with the features of custom adapters
for federated repositories and the handling of various types of dataobjects. Do not use this sample
in an actual production environment.
- Copy the AbstractAdapterImpl class and rename it before making changes. Make sure that the new
name is appropriate for your adapter.
Custom adapters for federated repositories must not depend on any WebSphere® Application Server
components, such as data sources and enterprise beans. These WebSphere Application Server
components require that security is initialized and enabled prior to startup. If your implementation
of the virtual member manager custom adapter needs to use data sources to connect to a database, you
need to use Java™ database connectivity (JDBC) to make the connection during server startup. Then, at a
later time, switch to using the data sources when the data source is available.
Procedure
- Build your implementation.
Note: EMF JAR files contain version number in their names, such as v200607270021. Make sure to
change the version number to reflect your installation.
To compile your code, you need the
following JAR files in the classpath:
Here is an
example:![[AIX Solaris HP-UX Linux Windows]](../images/dist.gif)
![[z/OS]](../images/ngzos.gif)
app_server_root/java/bin/javac -classpath
app_server_root/plugins/com.ibm.ws.runtime_6.1.0.jar;
app_server_root/plugins/org.eclipse.emf.commonj.sdo_2.1.0.
v200607270021.jar;app_server_root
/plugins/org.eclipse.emf.ecore_2.2.1.v200607270021.jar;
app_server_root/plugins/org.eclipse.emf.common_2.2.1.
v200607270021.jar;app_server_root/plugins/org.
eclipse.emf.ecore.xmi_2.2.0.v200607270021.jar;
app_server_root/plugins/org.eclipse.emf.ecore.sdo_2.2.0.v200607270021.jar
your_implementation_file.java
![[IBM i]](../images/iseries.gif)
"${java.home}/bin/javac -classpath
app_server_root/plugins/com.ibm.ws.runtime_6.1.0.jar;app_server_root/plugins/org.eclipse.emf.commonj.sdo_2.1.0.
v200607270021.jar;app_server_root/plugins/org.eclipse.emf.ecore_2.2.1.v200607270021.jar;
app_server_root/plugins/org.eclipse.emf.
common_2.2.1.v200607270021.jar;app_server_root/plugins/org.eclipse.emf.ecore.xmi_2.2.0.v200607270021.jar;
app_server_root/plugins/org.eclipse.emf.
ecore.sdo_2.2.0.v200607270021.jar your_implementation_file.java"
- Copy the generated class files or the packaged JAR file to the product classpath. The preferred location is the app_server_root/lib/ext directory. This should be
copied to the classpaths of all the product processes (cell and all NodeAgents).
- Configure your custom adapter by following the steps in Configuring custom adapters for federated repositories using wsadmin.
- Test your custom adapter by following the steps in Using custom adapters for federated repositories
What to do next
Configuring custom adapters for federated repositories using wsadmin provides details about configuring your
custom adapter with the wsadmin tool.