org.jboss.naming
Class NamingAlias

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

public class NamingAlias
extends org.jboss.system.ServiceMBeanSupport
implements NamingAliasMBean

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

Version:
$Revision: 57209 $
Author:
Scott Stark.

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
NamingAlias()
           
NamingAlias(String fromName, String toName)
           
 
Method Summary
 String getFromName()
          Get the from name of the alias.
 String getToName()
          Get the to name of the alias.
 void setFromName(String name)
          Set the from name of the alias.
 void setToName(String name)
          Set the to name of the alias.
protected  void startService()
           
protected  void stopService()
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, destroyService, getDeploymentInfo, 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, nextNotificationSequenceNumber, 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

NamingAlias

public NamingAlias()

NamingAlias

public NamingAlias(String fromName,
                   String toName)
Method Detail

getFromName

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

Specified by:
getFromName in interface NamingAliasMBean
Returns:
the location of the LinkRef

setFromName

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

Specified by:
setFromName in interface NamingAliasMBean
Parameters:
name, - the location where the LinkRef will be bound
Throws:
NamingException

getToName

public 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.

Specified by:
getToName in interface NamingAliasMBean
Returns:
the target JNDI name of the alias.

setToName

public void setToName(String name)
               throws 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.

Specified by:
setToName in interface NamingAliasMBean
Parameters:
name, - the target JNDI name of the alias.
Throws:
NamingException

startService

protected void startService()
                     throws Exception
Overrides:
startService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception

stopService

protected void stopService()
                    throws Exception
Overrides:
stopService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception


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