org.sapia.ubik.rmi.naming.remote.proxy
Class ReliableLocalContext

java.lang.Object
  extended by org.sapia.archie.jndi.proxy.ContextProxy
      extended by org.sapia.ubik.rmi.naming.remote.proxy.LocalContext
          extended by org.sapia.ubik.rmi.naming.remote.proxy.ReliableLocalContext
All Implemented Interfaces:
java.rmi.Remote, javax.naming.Context, AsyncEventListener

public class ReliableLocalContext
extends LocalContext
implements AsyncEventListener

An instance of this class is created by a ReliableInitialContextFactory. It allows clients to register ServiceDiscoveryListeners that are notified when new services are bound to the JNDI servers on the network.

Author:
Yanick Duchesne
Copyright:
Copyright © 2002-2003 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site
See Also:
RemoteInitialContextFactory, ServiceDiscoListener, ServiceDiscoveryEvent

Field Summary
 
Fields inherited from class org.sapia.ubik.rmi.naming.remote.proxy.LocalContext
_domainName, _mcastAddress, _mcastPort, _url
 
Fields inherited from class org.sapia.archie.jndi.proxy.ContextProxy
_ctx
 
Fields inherited from interface javax.naming.Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
 
Constructor Summary
ReliableLocalContext(EventChannel channel, java.lang.String url, RemoteContext ctx, boolean publish, ContextResolver resolver)
          Constructor for ReliableLocalContext.
 
Method Summary
 void addJndiDiscoListener(JndiDiscoListener listener)
          Adds a JNDI discovery listener to this instance.
 void addServiceDiscoListener(ServiceDiscoListener listener)
          Adds a service discovery listener to this instance.
 void bind(javax.naming.Name n, java.lang.Object o)
           
 void bind(java.lang.String n, java.lang.Object o)
           
 void close()
           
static ReliableLocalContext currentContext()
          Returns the instance of this class that is currently registered with the calling thread.
protected  void doFailOver(java.lang.reflect.UndeclaredThrowableException e)
           
 EventChannel getEventChannel()
           
 void onAsyncEvent(RemoteEvent evt)
          Receives multicast events.
 void rebind(javax.naming.Name n, java.lang.Object o)
           
 void rebind(java.lang.String n, java.lang.Object o)
           
 
Methods inherited from class org.sapia.ubik.rmi.naming.remote.proxy.LocalContext
composeName, composeName, createSubcontext, createSubcontext, destroySubcontext, destroySubcontext, getEnvironment, getNameInNamespace, getNameParser, getNameParser, list, list, listBindings, listBindings, lookup, lookup, lookupLink, lookupLink, onBind, onEnum, onLookup, onRebind, onSubContext, removeFromEnvironment, rename, rename, unbind, unbind
 
Methods inherited from class org.sapia.archie.jndi.proxy.ContextProxy
addToEnvironment, getAbsoluteName, getInternalContext, getNameParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReliableLocalContext

public ReliableLocalContext(EventChannel channel,
                            java.lang.String url,
                            RemoteContext ctx,
                            boolean publish,
                            ContextResolver resolver)
                     throws javax.naming.NamingException,
                            java.io.IOException
Constructor for ReliableLocalContext.

Throws:
javax.naming.NamingException
java.io.IOException
Method Detail

bind

public void bind(javax.naming.Name n,
                 java.lang.Object o)
          throws javax.naming.NamingException
Specified by:
bind in interface javax.naming.Context
Overrides:
bind in class LocalContext
Throws:
javax.naming.NamingException
See Also:
LocalContext.bind(Name, Object)

bind

public void bind(java.lang.String n,
                 java.lang.Object o)
          throws javax.naming.NamingException
Specified by:
bind in interface javax.naming.Context
Overrides:
bind in class LocalContext
Throws:
javax.naming.NamingException
See Also:
LocalContext.bind(String, Object)

rebind

public void rebind(javax.naming.Name n,
                   java.lang.Object o)
            throws javax.naming.NamingException
Specified by:
rebind in interface javax.naming.Context
Overrides:
rebind in class LocalContext
Throws:
javax.naming.NamingException
See Also:
LocalContext.rebind(Name, Object)

rebind

public void rebind(java.lang.String n,
                   java.lang.Object o)
            throws javax.naming.NamingException
Specified by:
rebind in interface javax.naming.Context
Overrides:
rebind in class LocalContext
Throws:
javax.naming.NamingException
See Also:
LocalContext.rebind(String, Object)

addServiceDiscoListener

public void addServiceDiscoListener(ServiceDiscoListener listener)
Adds a service discovery listener to this instance.

Parameters:
a - ServiceDiscoListener.

addJndiDiscoListener

public void addJndiDiscoListener(JndiDiscoListener listener)
Adds a JNDI discovery listener to this instance.

Parameters:
a - JndiDiscoListener.

onAsyncEvent

public void onAsyncEvent(RemoteEvent evt)
Description copied from interface: AsyncEventListener
Receives multicast events.

Specified by:
onAsyncEvent in interface AsyncEventListener
Parameters:
evt - a RemoteEvent.
See Also:
AsyncEventListener.onAsyncEvent(RemoteEvent)

doFailOver

protected void doFailOver(java.lang.reflect.UndeclaredThrowableException e)
                   throws javax.naming.NamingException
Overrides:
doFailOver in class LocalContext
Throws:
javax.naming.NamingException
See Also:
LocalContext.doFailOver(UndeclaredThrowableException)

close

public void close()
           throws javax.naming.NamingException
Specified by:
close in interface javax.naming.Context
Overrides:
close in class LocalContext
Throws:
javax.naming.NamingException
See Also:
LocalContext.close()

currentContext

public static ReliableLocalContext currentContext()
                                           throws java.lang.IllegalStateException
Returns the instance of this class that is currently registered with the calling thread.

Throws:
java.lang.IllegalStateException - if no instance of this class is currently registered.

getEventChannel

public EventChannel getEventChannel()
Returns:
the EventChannel used by this instance to perform discovery.


Copyright © 2010 Sapia OSS. All Rights Reserved.