org.jboss.naming
Class ExternalContext
java.lang.Object
|
+--javax.management.NotificationBroadcasterSupport
|
+--org.jboss.util.ServiceMBeanSupport
|
+--org.jboss.naming.ExternalContext
- All Implemented Interfaces:
- ExternalContextMBean, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, Service, ServiceMBean
- public class ExternalContext
- extends ServiceMBeanSupport
- implements ExternalContextMBean
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.
- Version:
- $Revision: 1.4 $
- Author:
- Scott_Stark@displayscape.com
- See Also:
NonSerializableFactory
Method Summary |
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.lang.String |
getName()
|
boolean |
getRemoteAccess()
Get the remote access flag. |
void |
initService()
|
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.lang.String contextPropsURL)
Set the InitialContex class environment properties. |
void |
setRemoteAccess(boolean remoteAccess)
Set the remote access flag. |
void |
startService()
Start the service by binding the external context into the
JBoss InitialContext. |
void |
stopService()
Stop the service by unbinding the external context into the
JBoss InitialContext. |
Methods inherited from class org.jboss.util.ServiceMBeanSupport |
destroy, destroyService, getObjectName, getState, getStateString, init, postDeregister, postRegister, preDeregister, preRegister, start, stop |
Methods inherited from class javax.management.NotificationBroadcasterSupport |
addNotificationListener, getNotificationInfo, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExternalContext
public ExternalContext()
ExternalContext
public ExternalContext(java.lang.String jndiName,
java.lang.String contextPropsURL)
throws java.io.IOException,
javax.naming.NamingException
getJndiName
public java.lang.String getJndiName()
- Set the jndi name under which the external context is bound.
- Specified by:
getJndiName
in interface ExternalContextMBean
setJndiName
public void setJndiName(java.lang.String jndiName)
throws javax.naming.NamingException
- Set the jndi name under which the external context is bound.
- Specified by:
setJndiName
in interface ExternalContextMBean
getRemoteAccess
public boolean getRemoteAccess()
- Description copied from interface:
ExternalContextMBean
- Get the remote access flag. If true, the external context is bound using
Serializable object that allows the InitialContext to be recreated
remotely.
- Specified by:
getRemoteAccess
in interface ExternalContextMBean
setRemoteAccess
public void setRemoteAccess(boolean remoteAccess)
- Description copied from interface:
ExternalContextMBean
- Set the remote access flag. If true, the external context is bound using
Serializable object that allows the InitialContext to be recreated
remotely.
- Specified by:
setRemoteAccess
in interface ExternalContextMBean
getInitialContext
public java.lang.String getInitialContext()
- Get the class name of the InitialContext implementation to
use. Should be one of:
javax.naming.InitialContext
javax.naming.directory.InitialDirContext
javax.naming.ldap.InitialLdapContext
- Specified by:
getInitialContext
in interface ExternalContextMBean
- 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:
javax.naming.InitialContext
javax.naming.directory.InitialDirContext
javax.naming.ldap.InitialLdapContext
The default is javax.naming.InitialContex.
- Specified by:
setInitialContext
in interface ExternalContextMBean
- Parameters:
contextClass,
- the classname of the InitialContext to use
setProperties
public void setProperties(java.lang.String contextPropsURL)
throws java.io.IOException
- Set the InitialContex class environment properties.
- Specified by:
setProperties
in interface ExternalContextMBean
- Following copied from interface:
org.jboss.naming.ExternalContextMBean
- Parameters:
contextPropsURL,
- either a URL string to a jndi.properties type of
content or a name of a resource to locate via the current thread
context classpath.- Throws:
IOException,
- thrown if the url/resource cannot be loaded.
getName
public java.lang.String getName()
- Specified by:
getName
in interface ServiceMBean
- Overrides:
getName
in class ServiceMBeanSupport
initService
public void initService()
throws java.lang.Exception
- Overrides:
initService
in class ServiceMBeanSupport
startService
public void startService()
throws java.lang.Exception
- Start the service by binding the external context into the
JBoss InitialContext.
- Overrides:
startService
in class ServiceMBeanSupport
stopService
public void stopService()
- Stop the service by unbinding the external context into the
JBoss InitialContext.
- Overrides:
stopService
in class ServiceMBeanSupport
Copyright © 2000 The JBoss Organization. All Rights Reserved.