The MetadataStrategy interface provides a pluggable strategy to decide which methods are asynchronous one-way operations and which objects should be remote (and so copied by reference over the wire rather than by value).
SimpleMetadataStrategy
The SimpleMetadataStrategy is the default implementation which works great for Java 1.x as it uses a simple convention...
- a set of interfaces/classes are used to identify remote object types. They default to any class implementing Remote or EventListener (used for JavaBean listeners).
- asynchronous one-way remoting is disabled by default but if enabled then any method which is void return and does not throw a checked exception is assumed to be an asynchronous one-way method.
The following example configuration demonstrates how you can configure a JMS proxy factory bean and enable async one way methods.
<bean id="client" class="org.logicblaze.lingo.jms.JmsProxyFactoryBean"> <property name="serviceInterface" value="org.logicblaze.lingo.example.ExampleService"/> <property name="connectionFactory" ref="jmsFactory"/> <property name="destination" ref="exampleDestination"/> <!-- lets enable async one ways on the client --> <property name="metadataStrategy" ref="metadataStrategy"/> </bean> <!-- define the metadata strategy --> <bean id="metadataStrategy" class="org.logicblaze.lingo.SimpleMetadataStrategy"> <!-- enable async one ways --> <constructor-arg value="true"/> </bean>
Java 5
Soon we should have a Java 5 based MetadataStrategy which supports JSR 181 annotations for specifying remote types and one-way invocations.
