|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sapia.ubik.ioc.spring.NamingServiceBean
public class NamingServiceBean
This singleton bean acts as a bridge to the Ubik JNDI server. It is internally used by the BeanExporterPostProcessor
and BeanImporterPostProcessor to respectively bind and lookup remote services.
This bean robustly discovers Ubik JNDI servers that appear in the domain if none are present at initialization time. The bound services are thus cached until a JNDI server is available.
| Constructor Summary | |
|---|---|
NamingServiceBean()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
void |
bind(java.lang.String name,
java.lang.Object o)
Binds the given object to the remote Ubik JNDI provider to which this instance corresponds. |
void |
destroy()
|
protected DiscoveryHelper |
getDiscoHelper(EventChannel channel)
|
protected DiscoveryHelper |
getDiscoHelper(java.lang.String domain,
java.lang.String mcastHost,
int mcastPort)
|
EventChannel |
getEventChannel()
|
protected javax.naming.InitialContext |
getInitialContext(java.lang.String domain,
java.lang.String host,
int port)
|
java.lang.Object |
lookup(java.lang.String name)
Looks up the object under the given name. |
void |
onJndiDiscovered(javax.naming.Context context)
|
void |
register(ServiceDiscoListener listener)
Registers the given listener with this instance. |
void |
setDomain(java.lang.String domain)
|
NamingServiceBean |
setJndiHost(java.lang.String host)
|
NamingServiceBean |
setJndiPort(int port)
|
void |
setMulticastAddress(java.lang.String addr)
|
void |
setMulticastPort(int port)
|
void |
unregister(ServiceDiscoListener listener)
Unregisters the given listener from this instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NamingServiceBean()
| Method Detail |
|---|
public NamingServiceBean setJndiHost(java.lang.String host)
host - the host of the remote Ubik JNDI server.public NamingServiceBean setJndiPort(int port)
port - the port of the remote Ubik JNDI server.public void setDomain(java.lang.String domain)
domain - the domain of the remote Ubik JNDI server.public void setMulticastAddress(java.lang.String addr)
addr - the multicast address to use for discovering remote
JNDI servers.public void setMulticastPort(int port)
port - the multicast port to use for discovering remote
JNDI servers.public EventChannel getEventChannel()
public void bind(java.lang.String name,
java.lang.Object o)
throws javax.naming.NamingException
NamingService
bind in interface NamingServicename - the name under which to bind the object.o - the object to bind.
javax.naming.NamingException
public java.lang.Object lookup(java.lang.String name)
throws javax.naming.NamingException,
javax.naming.NameNotFoundException
NamingService
lookup in interface NamingServicename - the name of the remote object to lookup.
javax.naming.NamingException
javax.naming.NameNotFoundExceptionpublic void register(ServiceDiscoListener listener)
NamingService
register in interface NamingServicelistener - a ServiceDiscoListener.public void unregister(ServiceDiscoListener listener)
NamingService
unregister in interface NamingServicelistener - a ServiceDiscoListener.
public void destroy()
throws java.lang.Exception
destroy in interface org.springframework.beans.factory.DisposableBeanjava.lang.Exception
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic void onJndiDiscovered(javax.naming.Context context)
onJndiDiscovered in interface JndiDiscoListener
protected DiscoveryHelper getDiscoHelper(java.lang.String domain,
java.lang.String mcastHost,
int mcastPort)
throws java.io.IOException
java.io.IOException
protected DiscoveryHelper getDiscoHelper(EventChannel channel)
throws java.io.IOException
java.io.IOException
protected javax.naming.InitialContext getInitialContext(java.lang.String domain,
java.lang.String host,
int port)
throws javax.naming.NamingException
javax.naming.NamingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||