|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jmx4odp.pool.AbstractContextPool
public abstract class AbstractContextPool
This pool does not implement a getAailableContext method, that is implemented by the overriding class. Each implemntation class should implemeney a different strategy for finding the next available context. All other methods, such as adding new contexts to the pool, updating status, and fetching specific context should remain the same
| Field Summary |
|---|
| Fields inherited from interface org.jmx4odp.pool.ContextPool |
|---|
DOWN_SERVICE_RETRY_WAIT, INSTANCE_ID, SERVICE_NAME, SERVICE_STATUS, STATUS_DOWN, STATUS_DOWN_DATE, STATUS_UNKOWN, STATUS_UP |
| Constructor Summary | |
|---|---|
AbstractContextPool()
Creates a new instance of ServiceContextContainer |
|
| Method Summary | |
|---|---|
void |
addContext(javax.naming.Context ctx)
Add a loaded context to this pool. |
boolean |
checkIfContextIsUp(javax.naming.Context ctx)
This is a utility function mostly intended for subclasses. |
abstract javax.naming.Context |
getAvailableContext()
This needs to be implemented by whatever the strategey of the child class is. |
javax.naming.Context |
getContext(javax.naming.Context ctx)
Given a context, it will look for the INSTANCE_ID property and find the matching context in the pool. |
javax.naming.Context |
getContext(int i)
Given an index it will return this specific context from the pool. |
javax.naming.Context |
getContext(java.lang.String id)
Given an index it will return this specific ontext from the pool |
int |
getNumberOfServices()
|
java.lang.String |
getServiceName()
Getter for property serviceName. |
java.lang.String |
getStatus(javax.naming.Context ctx)
Given a context, it will return the status of this context: STATUS_UNKOWN, STATUS_UP, or STATUS_DOWN |
java.lang.String |
getStatus(int index)
return the status of the instance at the given index |
java.lang.String |
getStatus(java.lang.String id)
return the status of the instance at the given index |
protected boolean |
markContextDown(javax.naming.Context ctx)
This function is private, because it needs to only accept contexts that are known to be refs to the one kept in this pool. |
protected boolean |
markContextUp(javax.naming.Context ctx)
This function is private, because it needs to only accept contexts that are known to be refs to the one kept in this pool. |
boolean |
markDown(javax.naming.Context ctx)
Given a context, find the matching on in the system (In case this is a copy and not a ref) and then set it to down. |
boolean |
markDown(int index)
Given a context, find the matching on in the system (In case this is a copy and not a ref) and then set it to down. |
boolean |
markDown(java.lang.String id)
Given a context, find the matching on in the system (In case this is a copy and not a ref) and then set it to down. |
boolean |
markUp(javax.naming.Context ctx)
Given a context, find the matching on in the system (In case this is a copy and not a ref) and then set it to down. |
boolean |
markUp(int index)
Given a context, find the matching on in the system (In case this is a copy and not a ref) and then set it to down. |
boolean |
markUp(java.lang.String id)
Given a context, find the matching on in the system (In case this is a copy and not a ref) and then set it to down. |
void |
setServiceName(java.lang.String name)
Setter for property serviceName. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractContextPool()
| Method Detail |
|---|
public java.lang.String getServiceName()
getServiceName in interface ContextPoolpublic void setServiceName(java.lang.String name)
setServiceName in interface ContextPoolserviceName - New value of property serviceName.public int getNumberOfServices()
getNumberOfServices in interface ContextPool
public javax.naming.Context getContext(int i)
throws javax.naming.NamingException
getContext in interface ContextPooli - index of the context in the pool
javax.naming.NamingException - if there is no matching Context
public javax.naming.Context getContext(java.lang.String id)
throws javax.naming.NamingException
getContext in interface ContextPoolid - (usually the index) of the context
javax.naming.NamingException - if there is no matching Context
public javax.naming.Context getContext(javax.naming.Context ctx)
throws javax.naming.NamingException
getContext in interface ContextPoolcontext - containing the id property.
javax.naming.NamingException - if there is no matching Contextpublic java.lang.String getStatus(int index)
getStatus in interface ContextPoolpublic java.lang.String getStatus(java.lang.String id)
getStatus in interface ContextPoolpublic java.lang.String getStatus(javax.naming.Context ctx)
getStatus in interface ContextPoolpublic boolean markUp(int index)
markUp in interface ContextPoolindex - of the service service context to mark as up
public boolean markUp(java.lang.String id)
markUp in interface ContextPoolif - of the service context to mark as up
public boolean markUp(javax.naming.Context ctx)
markUp in interface ContextPoolContext, - service context to mark as up
public boolean markDown(int index)
markDown in interface ContextPoolindex - of the service service context to mark as down
public boolean markDown(java.lang.String id)
markDown in interface ContextPoolif - of the service context to mark as down
public boolean markDown(javax.naming.Context ctx)
markDown in interface ContextPoolContext, - service context to mark as down
protected boolean markContextDown(javax.naming.Context ctx)
protected boolean markContextUp(javax.naming.Context ctx)
public abstract javax.naming.Context getAvailableContext()
throws NoObjectsInPoolException
getAvailableContext in interface ContextPoolNoObjectsInPoolExceptionpublic boolean checkIfContextIsUp(javax.naming.Context ctx)
public void addContext(javax.naming.Context ctx)
throws javax.naming.NamingException
addContext in interface ContextPooljavax.naming.NamingException - if we cannot add this context to this pool.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||