站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 server API Documentation 英文版文档

ExternalContext (JBoss Server API) - JBoss 4.0.1 sp1 server API Documentation 英文版文档


org.jboss.naming
Class ExternalContext

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.naming.ExternalContext
All Implemented Interfaces:
ExternalContextMBean, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class ExternalContext
extends org.jboss.system.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.17 $
Author:
Scott.Stark@jboss.org, Jason Dillon
See Also:
NonSerializableFactory

Nested Class Summary
static class ExternalContext.SerializableInitialContext
          The external InitialContext information class.
 
Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
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(String jndiName, String contextPropsURL)
           
 
Method Summary
 boolean getCacheContext()
           
 String getInitialContext()
          Get the class name of the InitialContext implementation to use.
 String getJndiName()
          Set the jndi name under which the external context is bound.
 Properties getProperties()
          Get the InitialContex class environment properties.
 boolean getRemoteAccess()
           
 void setCacheContext(boolean cacheContext)
           
 void setInitialContext(String className)
          Set the class name of the InitialContext implementation to use.
 void setJndiName(String jndiName)
          Set the jndi name under which the external context is bound.
 void setProperties(Properties props)
          Set the InitialContex class environment properties.
 void setPropertiesURL(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
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
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Constructor Detail

ExternalContext

public ExternalContext()
No-args constructor for JMX.


ExternalContext

public ExternalContext(String jndiName,
                       String contextPropsURL)
                throws IOException,
                       NamingException
Method Detail

getJndiName

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

Specified by:
getJndiName in interface ExternalContextMBean

setJndiName

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

Specified by:
setJndiName in interface ExternalContextMBean
Throws:
NamingException

getRemoteAccess

public boolean getRemoteAccess()
Specified by:
getRemoteAccess in interface ExternalContextMBean

setRemoteAccess

public void setRemoteAccess(boolean remoteAccess)
Specified by:
setRemoteAccess in interface ExternalContextMBean

getCacheContext

public boolean getCacheContext()
Specified by:
getCacheContext in interface ExternalContextMBean

setCacheContext

public void setCacheContext(boolean cacheContext)
Specified by:
setCacheContext in interface ExternalContextMBean

getInitialContext

public 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(String className)
                       throws 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

Specified by:
setInitialContext in interface ExternalContextMBean
Throws:
ClassNotFoundException

setPropertiesURL

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

Specified by:
setPropertiesURL in interface ExternalContextMBean
Throws:
IOException

setProperties

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

Specified by:
setProperties in interface ExternalContextMBean
Throws:
IOException

getProperties

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

Specified by:
getProperties in interface ExternalContextMBean
Throws:
IOException

startService

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

Throws:
Exception

stopService

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

Throws:
Exception


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.