|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the ApplicationPool interface. It needs to be implemented by any class that is intended
to provide a customized pool interface. Look at ApplicationPoolImpl for the default implementation.
View Implementation of ApplicationPool
View Implementation of ApplicationPoolImpl
Method Summary | |
void |
checkin(ApplicationModule instance)
Checks in an application instance that had previously been checked out. |
java.lang.String |
checkinWithSessionState(ApplicationModule appModule)
Check-in the application module as being referenced by the invoking session thread. |
ApplicationModule |
checkout()
Checks out an application instance from the pool. |
ApplicationModule |
checkout(java.lang.String sessionId)
Returns an application module for the specified session id. |
void |
commitAndSyncCache(ApplicationModule instance)
Given an intitial Application Module instance, synchronizes the caches of all Application Module instances in the pool. |
ApplicationModule |
createNewInstance()
Creates a new instance of an application without looking for an available instance in the pool. |
java.lang.String |
getApplicationModuleClass()
Return the class name of the application modules being managed by the pool. |
int |
getAvailableNumPools()
Gets the snapshot of available number of pools returns number of available pools |
java.lang.String |
getConnectString()
Return the connect string of the application modules being managed by the application pool. |
long |
getCreationTimeMillis(ApplicationModule instance)
Gets the time when the app module was created (in milli-secs). |
java.util.Hashtable |
getEnvironment()
Returns the Hashtable that was used to initialie the Contect for the application modules. |
ApplicationModule |
getInstance(int nIndex)
Returns the application instance represented by the instance index. |
int |
getInstanceCount()
Returns the number of instances that the Application Pool has created. |
java.lang.String |
getPassword()
Returns the password. |
java.lang.String |
getPoolName()
Returns the pool's name. |
long |
getTimeToCreateMillis(ApplicationModule instance)
Gets the time that it will tke to create the application module (in milli-secs). |
java.util.Hashtable |
getUserData()
Returns the User Data hashtable. |
java.lang.String |
getUserName()
Returns the user name. |
void |
initialize(java.lang.String sPoolName,
java.lang.String sApplicationModule,
java.lang.String sConnectString,
java.util.Hashtable env)
This initializes the ApplicationPool. |
boolean |
isAvailable(ApplicationModule instance)
Indicates whether this application module is available. |
void |
releaseInstances()
Causes the pool to release all the application isntances that have been created so far. |
void |
setAvailable(ApplicationModule instance,
boolean bSet)
Sets the instance to available or not |
void |
setPassword(java.lang.String sPassword)
|
void |
setUserData(java.util.Hashtable data)
Replaces the userData with the new Hashtable. |
void |
setUserName(java.lang.String sUser)
|
Method Detail |
public void initialize(java.lang.String sPoolName, java.lang.String sApplicationModule, java.lang.String sConnectString, java.util.Hashtable env) throws java.lang.Exception
ConnectionInfo
documentation since it controls the key information for initializing
the application pool.sPoolName
- the name of the application module pool.sApplicationModule
- name of the application module for which the pool will be created.sConnectString
- the connection string to use to connect to the database.env
- name of the hash table containing the environment variables for the selected platform.public java.lang.String getApplicationModuleClass()
public java.lang.String getConnectString()
public java.util.Hashtable getEnvironment()
public void checkin(ApplicationModule instance)
instance
- name of the application module instance to check in.public java.lang.String checkinWithSessionState(ApplicationModule appModule)
This method should be used by pool clients that wish to maintain logical application module state while still sharing an application module resource across requests. The method returns a system generated session id for the check-in that should be used as the unique application module identifier by the client session.
The application module will be passivated immediately if failover support has been requested (default). If failover support has been disable, through the jbo.DoFailover system parameter, the application module will not be passivated until it is re-used by a session other than the session checking in the application module.
appModule
- the application module that will be checked inpublic boolean isAvailable(ApplicationModule instance)
instance
- the application module instance that you want to
test for availability.public void setAvailable(ApplicationModule instance, boolean bSet)
public ApplicationModule checkout() throws java.lang.Exception
public ApplicationModule checkout(java.lang.String sessionId)
checkinWithSessionState(ApplicationModule)
against this application module pool.
The session id will be used to obtain an application module with the same state as the application module that had been returned by the session with checkinWithSessionState.
If an unrecognized session id is specified than the implementation returns an empty application module.
sessionId
- the name of the session ID for which you want to return the
associated application module.public void releaseInstances()
public int getInstanceCount()
public ApplicationModule createNewInstance() throws java.lang.Exception
checkout()
instead.public ApplicationModule getInstance(int nIndex)
nIndex
- the index of the application instance.public java.lang.String getPoolName()
public java.util.Hashtable getUserData()
public void setUserData(java.util.Hashtable data)
the
- new hashtable to use for the environment information.public int getAvailableNumPools()
public long getTimeToCreateMillis(ApplicationModule instance)
instance
- the application module instance for which you want to
know how long it will take to create it.public long getCreationTimeMillis(ApplicationModule instance)
instance
- the application module instance for which you want to
know the time of creation.public java.lang.String getUserName()
public java.lang.String getPassword()
public void setUserName(java.lang.String sUser)
public void setPassword(java.lang.String sPassword)
public void commitAndSyncCache(ApplicationModule instance)
This method commits the transaction for instance. Then, it loops through all other instances of the Application Module in the pool and synchronizes their caches with the changes committed by instance. For example:
// Insert a new row row = voEmp1.createRow(); row.setAttribute("EmpNum", new Integer(9999)); row.setAttribute("EmpName", "NewPers"); row.setAttribute("EmpJob", "JOBX"); voEmp1.insertRow(row); // Commit the changes for the specified instance, then sync // them with the rest of the Application Module instances. pool1.commitAndSyncCache(am1);
instance
- an instance of an Application Module in the pool.
|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |