org.jboss.naming
Class ExternalContext

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.naming.ExternalContext
All Implemented Interfaces:
MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)

public class ExternalContext
extends ServiceMBeanSupport (src)

A MBean that binds an arbitrary InitialContext into the JBoss default InitialContext as a Reference. If RemoteAccess is enabled, the reference is a Serializable object that is capable of creating the InitialContext remotely. If RemoteAccess if false, the reference is to a nonserializable object that can only be used from within this VM.

See Also:
NonSerializableFactory (src)

Nested Class Summary
static class ExternalContext.SerializableInitialContext (src)
          The external InitialContext information class.
 
Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
ExternalContext()
          No-args constructor for JMX.
ExternalContext(java.lang.String jndiName, java.lang.String contextPropsURL)
           
 
Method Summary
 boolean getCacheContext()
           
 java.lang.String getInitialContext()
          Get the class name of the InitialContext implementation to use.
 java.lang.String getJndiName()
          Set the jndi name under which the external context is bound.
 java.util.Properties getProperties()
          Get the InitialContex class environment properties.
 boolean getRemoteAccess()
           
 void setCacheContext(boolean cacheContext)
           
 void setInitialContext(java.lang.String className)
          Set the class name of the InitialContext implementation to use.
 void setJndiName(java.lang.String jndiName)
          Set the jndi name under which the external context is bound.
 void setProperties(java.util.Properties props)
          Set the InitialContex class environment properties.
 void setPropertiesURL(java.lang.String contextPropsURL)
          Set the InitialContex class environment properties from the given URL.
 void setRemoteAccess(boolean remoteAccess)
           
protected  void startService()
          Start the service by binding the external context into the JBoss InitialContext.
protected  void stopService()
          Stop the service by unbinding the external context into the JBoss InitialContext.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExternalContext

public ExternalContext()
No-args constructor for JMX.


ExternalContext

public ExternalContext(java.lang.String jndiName,
                       java.lang.String contextPropsURL)
                throws java.io.IOException,
                       javax.naming.NamingException
Method Detail

getJndiName

public java.lang.String getJndiName()
Set the jndi name under which the external context is bound.


setJndiName

public void setJndiName(java.lang.String jndiName)
                 throws javax.naming.NamingException
Set the jndi name under which the external context is bound.

Throws:
javax.naming.NamingException

getRemoteAccess

public boolean getRemoteAccess()

setRemoteAccess

public void setRemoteAccess(boolean remoteAccess)

getCacheContext

public boolean getCacheContext()

setCacheContext

public void setCacheContext(boolean cacheContext)

getInitialContext

public java.lang.String getInitialContext()
Get the class name of the InitialContext implementation to use. Should be one of:

Returns:
the classname of the InitialContext to use

setInitialContext

public void setInitialContext(java.lang.String className)
                       throws java.lang.ClassNotFoundException
Set the class name of the InitialContext implementation to use. Should be one of:

Throws:
java.lang.ClassNotFoundException

setPropertiesURL

public void setPropertiesURL(java.lang.String contextPropsURL)
                      throws java.io.IOException
Set the InitialContex class environment properties from the given URL.

Throws:
java.io.IOException

setProperties

public void setProperties(java.util.Properties props)
                   throws java.io.IOException
Set the InitialContex class environment properties.

Throws:
java.io.IOException

getProperties

public java.util.Properties getProperties()
                                   throws java.io.IOException
Get the InitialContex class environment properties.

Throws:
java.io.IOException

startService

protected void startService()
                     throws java.lang.Exception
Start the service by binding the external context into the JBoss InitialContext.

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

stopService

protected void stopService()
                    throws java.lang.Exception
Stop the service by unbinding the external context into the JBoss InitialContext.

Overrides:
stopService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception