|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--net.larsan.urd.jndi.ContextBase
|
+--net.larsan.urd.jndi.ContextImpl
|
+--net.larsan.urd.impl.ContainerBase
A container is an abstraction for a place from which one or more service is excpected to be loaded. The container is responsible for the lifecycle of it's 'children'.
This class is abstract to allow containers to load classes from different source types.
| Field Summary | |
protected boolean |
autoStart
Autostart services. |
protected DefaultErrorHandler |
errorHandler
Error handle for the container |
protected java.lang.String |
name
Local namespace name. |
| Fields inherited from class net.larsan.urd.jndi.ContextBase |
ACCESS_PERMISSION, env, handler, localName, nameParser, parent, port, root, ROOT_ADDRESS, ROOT_PORT |
| Fields inherited from interface javax.naming.event.EventContext |
OBJECT_SCOPE, ONELEVEL_SCOPE, SUBTREE_SCOPE |
| Fields inherited from interface javax.naming.Context |
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES |
| Constructor Summary | |
ContainerBase(ContextBase parentContext,
java.lang.String localName)
Create container |
|
| Method Summary | |
protected void |
autoStart(Servicebox box)
Autostart a service. |
void |
destroy()
Destroy component. |
void |
doAutoStarts()
Attempt to start all autostart services. |
java.lang.String |
findServiceID(java.lang.String url)
Resolve a service URL into an id. |
boolean |
getAutoStart()
Determine if the services within this contianer should be auto-started. |
protected Servicebox |
getByIdImpl(java.lang.String id)
Get service by id. |
protected Servicebox |
getByURLImpl(java.lang.String url)
Get service by url. |
protected abstract java.lang.String |
getContainerID()
Get the container id. |
ListInfo |
info(java.lang.String serviceId)
Get if no for a particular service. |
void |
init(DefaultErrorHandler errorHandler)
Initiate the container. |
ListInfo[] |
list()
List all service within this container. |
protected Servicebox |
removeServiceImpl(java.lang.String url)
Remove a service by URL. |
void |
setAutoStart(boolean autoStart)
Set if the services within this container should be auto-started. |
protected void |
setServiceImpl(java.lang.String cuid,
Servicebox box)
Add a service to the container collection. |
void |
start(java.lang.String serviceId)
Start a single service. |
void |
stop(java.lang.String serviceId)
Stop a single service. |
| Methods inherited from class net.larsan.urd.jndi.ContextImpl |
bind, clone, close, composeName, createSubcontext, destroySubcontext, getNameParser, hashCode, list, listBindings, lookup, lookupLink, rebind, rename, toString, unbind |
| Methods inherited from class net.larsan.urd.jndi.ContextBase |
addNamingListener, addNamingListener, addToEnvironment, bind, checkAccess, composeName, createSubcontext, destroySubcontext, findRootContext, getEnvironment, getEventHandler, getNameInNamespace, getNameParser, getParent, list, listBindings, lookup, lookupLink, objectAdded, objectRemoved, objectRenamed, rebind, removeFromEnvironment, removeNamingListener, rename, setHandler, targetMustExist, unbind |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.String name
protected DefaultErrorHandler errorHandler
protected boolean autoStart
| Constructor Detail |
public ContainerBase(ContextBase parentContext,
java.lang.String localName)
parentContext - Container JNDI contextlocalName - Local context name of the container| Method Detail |
protected abstract java.lang.String getContainerID()
public boolean getAutoStart()
public void setAutoStart(boolean autoStart)
public void init(DefaultErrorHandler errorHandler)
throws ContainerException
errorHandler - Error handle for this container
ContainerException - Id the container cannot start
public void start(java.lang.String serviceId)
throws NoSuchServiceException
start in interface ContainerserviceId - Service name to start
NoSuchServiceException - If the service is not found
public void stop(java.lang.String serviceId)
throws NoSuchServiceException
stop in interface ContainerserviceId - Service id to start
NoSuchServiceException - If the service is not found
public ListInfo info(java.lang.String serviceId)
throws NoSuchServiceException
info in interface ContainerNoSuchServiceException - If the service is not foundpublic void doAutoStarts()
doAutoStarts in interface Containerpublic java.lang.String findServiceID(java.lang.String url)
findServiceID in interface Containerurl - Service URL to look for
public ListInfo[] list()
list in interface Containerpublic void destroy()
destroy in interface Destroyableprotected void autoStart(Servicebox box)
protected Servicebox getByIdImpl(java.lang.String id)
id - Service id
protected Servicebox getByURLImpl(java.lang.String url)
url - Service context url
protected Servicebox removeServiceImpl(java.lang.String url)
throws javax.naming.NamingException
url - Service context url
javax.naming.NamingException
protected void setServiceImpl(java.lang.String cuid,
Servicebox box)
throws javax.naming.NamingException,
AlreadyRegisteredException
cuid - Service id within the containerbox - Service to add, must not be null
javax.naming.NamingException
AlreadyRegisteredException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||