org.jboss.naming
Class NamingAlias

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

public class NamingAlias
extends ServiceMBeanSupport (src)

A simple utility mbean that allows one to create an alias in the form of a LinkRef from one JNDI name to another.


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
NamingAlias()
           
NamingAlias(java.lang.String fromName, java.lang.String toName)
           
 
Method Summary
 java.lang.String getFromName()
          Get the from name of the alias.
 java.lang.String getToName()
          Get the to name of the alias.
 void setFromName(java.lang.String name)
          Set the from name of the alias.
 void setToName(java.lang.String name)
          Set the to name of the alias.
protected  void startService()
          Sub-classes should override this method to provide custum 'start' logic.
protected  void stopService()
          Sub-classes should override this method to provide custum 'stop' logic.
 
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

NamingAlias

public NamingAlias()

NamingAlias

public NamingAlias(java.lang.String fromName,
                   java.lang.String toName)
Method Detail

getFromName

public java.lang.String getFromName()
Get the from name of the alias. This is the location where the LinkRef is bound under JNDI.

Returns:
the location of the LinkRef

setFromName

public void setFromName(java.lang.String name)
                 throws javax.naming.NamingException
Set the from name of the alias. This is the location where the LinkRef is bound under JNDI.

Throws:
javax.naming.NamingException

getToName

public java.lang.String getToName()
Get the to name of the alias. This is the target name to which the LinkRef refers. The name is a URL, or a name to be resolved relative to the initial context, or if the first character of the name is ".", the name is relative to the context in which the link is bound.

Returns:
the target JNDI name of the alias.

setToName

public void setToName(java.lang.String name)
               throws javax.naming.NamingException
Set the to name of the alias. This is the target name to which the LinkRef refers. The name is a URL, or a name to be resolved relative to the initial context, or if the first character of the name is ".", the name is relative to the context in which the link is bound.

Throws:
javax.naming.NamingException

startService

protected void startService()
                     throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'start' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

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

stopService

protected void stopService()
                    throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'stop' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

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