How can I implement additional calls of services?
The central units from this framework are:
The framework distinguish two kinds of Proxies:
If you want create your own implementation with the static proxy, you have to extend the class net.sf.crispy.StaticProxy.
The extended static proxy class, is responsible for the method newInstance. The StaticEjbProxy for example makes in this method a JNDI lookup.
The framework support two implementation of Dynamic Proxies:
The DynamicProxy class needn't to extend. If you want to create an additional implementation, you have to extend the net.sf.crispy.Executor class. You have to implement the abstract method execute and the method getDefaultUrlAndPort. The execute method make the call to the remote server.
When the DynamicProxy is not enough, than can you make your own implementation. You must implement the methods:
After the implementation from your own extension, you can test the compatibility. This is possible with the net.sf.crispy.util.compatibility.CompatibilityKit:
CompatibilityKit compatibilityKit = new CompatibilityKit(); compatibilityKit.addProperty(Property.EXECUTOR_CLASS, XmlRpcExecutor.class.getName()); compatibilityKit.makeAllTests("XmlRpc", new MiniXmlRpcServer());
You have to add the Executor or the StaticProxy class to the properties. If the CompatibilityKit has to manage a server instance, then one parameter is an instance of the net.sf.crispy.impl.MiniServer interface. This parameter is optional. If is no server set, the server has to be started externally.
for example:
(classpath: commons-codec.jar;commons-logging.jar;commons-httpclient.jar;servlet.jar; xmlrpc.jar;crispy.jar) java net.sf.crispy.impl.xmlrpc.MiniXmlRpcServer
If the test is not successful, then a CompatibilityException is thrown.