org.sapia.ubik.ioc.guice
Class RemoteServiceExporter<T>
java.lang.Object
org.sapia.ubik.ioc.guice.RemoteServiceExporter<T>
- Type Parameters:
T - the type of the object to export.
- All Implemented Interfaces:
- com.google.inject.Provider<T>
public class RemoteServiceExporter<T>
- extends java.lang.Object
- implements com.google.inject.Provider<T>
This class implements a Provider that exports an arbitrary object to Ubik's JNDI.
An instance of this class expects a NamingService as a dependency.
Example:
// creating the NamingService instance and binding it to Guice
final NamingService naming = new NamingServiceImpl("default")
.setJndiHost(Localhost.getLocalAddress().getHostAddress())
.setJndiPort(1099);
Injector injector = Guice.createInjector(new AbstractModule(){
- Author:
- yduchesne
- See Also:
get(),
RemoteServiceImporter
|
Method Summary |
T |
get()
This method returns the object that must be exported. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RemoteServiceExporter
public RemoteServiceExporter(T toExport,
java.lang.String jndiName)
get
public T get()
- This method returns the object that must be exported. At its first invocation, this method will export its
encapsulated object to Ubik's JNDI.
- Specified by:
get in interface com.google.inject.Provider<T>
Copyright © 2010 Sapia OSS. All Rights Reserved.