public class BulletinBoardService extends AppService implements BulletinBoardServiceRemote, Service
Please note that this is not for inter-thread communication, for that purpose, please see psdi.server.SharedSpace.
This service is not persistent. If the server hosting this service goes down, all already posted messages will be lost when the server starts up.
Currently this service is implemented as a singleton service, which means only one MXServer in the enterprise can host the service. However, we are considering the future plan to upgrade it to be duplicated services by enabling posted messages to be broadcasted to all the bulletin boards.
APPLOGGER, CRONTASKLOGGER, CRONTASKMGRLOGGER, CRONTASKMGRSQLLOGGER, DBCONNECTIONLOGGER, DDLOGGER, DMLOGGER, EVENTLOGGER, EXCEPTIONLOGGER, MAILLOGGER, MAXIMOLOGGER, MTLOGGER, NULLMBOPOINTER, SECURITY, SENDFAILEDLOGGER, SERVICELOGGER, SQLLOGGER
appenderPrefix, LOGGERNAME_APP, LOGGERNAME_CRONTASK, LOGGERNAME_CRONTASKMGR, LOGGERNAME_DBCONNECTION, LOGGERNAME_DD, LOGGERNAME_DM, LOGGERNAME_DMPREVIEW, LOGGERNAME_EVENT, LOGGERNAME_EXCEPTION, LOGGERNAME_MAIL, LOGGERNAME_MAXIMO, LOGGERNAME_MT, LOGGERNAME_NULLMBOPOINTER, LOGGERNAME_SECURITY, LOGGERNAME_SENDFAILED, LOGGERNAME_SERVICE, LOGGERNAME_SQL, LOGGERNAME_SQL_CRONTASKMGR, LOGGERNAME_TXN, loggerPrefix
Constructor and Description |
---|
BulletinBoardService() |
BulletinBoardService(MXServer mxServer) |
BulletinBoardService(java.lang.String url,
MXServer mxServer) |
Modifier and Type | Method and Description |
---|---|
void |
configure(java.util.Properties configData)
Configuration information is presented in a Property object.
|
void |
destroy()
Release system resources.
|
java.lang.String |
getURL()
Used by ServiceCoordinator
|
void |
init()
Initialization should take place.
|
boolean |
isAppService()
Used by ServiceCoordinator
|
boolean |
isInitialized()
Check if class has been initialized.
|
boolean |
isPosted(java.lang.String key)
Check if a message is posted on the bulletin board by the same thread.
|
boolean |
isPosted(java.lang.String key,
UserInfo userInfo)
Check if a message is posted on the bulletin board by the same user connection.
|
void |
post(java.lang.String key)
Post a message to the bulletin board.
|
void |
post(java.lang.String key,
UserInfo userInfo)
Post a message to the bulletin board.
|
void |
remove(java.lang.String key)
Remove one posting of the message from the bulletin board.
|
void |
remove(java.lang.String key,
UserInfo userInfo)
Remove one posting of the message from the bulletin board.
|
void |
restart()
Indicates that the Service should reload any internal
cache's of information it's holding.
|
void |
setURL(java.lang.String url)
Required by ServiceRemote.
|
checkSecurity, freeDBConnection, freeMboSet, getCriteria, getCurrentState, getDBConnection, getLiveObjCount, getLoad, getMaximoDD, getMaxVar, getMboSet, getMXServer, getName, getProfile, getProxy, getSchemaOwner, getServiceInfo, getServiceLogger, getSetForRelationship, getSetFromKeys, getStateCmdList, getStateList, initCriteriaList, isRunning, isSingletonService, setProxy, setRunning, verifyUser, verifyUser
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, isSingletonService
getName, isSingletonService
getName
public BulletinBoardService() throws java.rmi.RemoteException
java.rmi.RemoteException
public BulletinBoardService(MXServer mxServer) throws java.rmi.RemoteException
mxServer
- -- the "Server Environment" this Service is being
created in.java.rmi.RemoteException
public BulletinBoardService(java.lang.String url, MXServer mxServer) throws java.rmi.RemoteException
java.rmi.RemoteException
public void post(java.lang.String key)
The message will only be posted for this thread. If there is the same message posted by a different thread, it will be ignored. If the message is posted for the use by a method belonging to another object, which could be an rmi stub object, this method can NOT be used. Use the overloaded one post(String, UserInfo) instead.
Method post() has to be called in pairs with remove(). One thread can post the same message at different moment for multiple time, but there should be one remove() paired up with one post() everytime when the message is posted. If exception could occur after the message is posted and before a remove() can be called, try-finally blocks need to be used to make sure remove() is guaranteed to be called.
Example:
MXServer.getBulletinBoard().post("Invoice.NOOPSYSCODE");
try{
doSomething();
}
finally{
MXServer.getBulletinBoard().remove("Invoice.NOOPSYSCODE");
}
post
in interface BulletinBoardServiceRemote
key
- The message being posted. Key has to be different one another if they
represent different meanings. It is recommended to contain the information of the
package or object and the function. For example: Invoice.NOOPSYSCODE.remove(java.lang.String)
public void post(java.lang.String key, UserInfo userInfo)
The message will only be posted for this user connection. If there is the same message posted by a different connection, it will be ignored. Method post() has to be called in pairs with remove(). One thread can post the same message at different moment for multiple time, but there should be one remove() paired up with one post() everytime when the message is posted. If exception could occur after the message is posted and before a remove() can be called, try-finally blocks need to be used to make sure remove() is guaranteed to be called.
Example:
MXServer.getBulletinBoard().post("Invoice.NOOPSYSCODE", UserInfo);
try{
doSomething();
}
finally{
MXServer.getBulletinBoard().remove("Invoice.NOOPSYSCODE", UserInfo);
}
post
in interface BulletinBoardServiceRemote
key
- The message being posted. Key has to be different one another if they
represent different meanings. It is recommended to contain the information of the
package or object and the function. For example: Invoice.NOOPSYSCODE.userInfo
- The UserInfo object which contains the specific connection information.
It has to be the one that the execution is performed on behalf, which has to be
the same as the execution where reads and removes this message.remove(String, UserInfo)
public boolean isPosted(java.lang.String key)
isPosted
in interface BulletinBoardServiceRemote
key
- The message being checked. Key has to be different one another if they
represent different meanings.post(java.lang.String)
,
remove(java.lang.String)
public boolean isPosted(java.lang.String key, UserInfo userInfo)
isPosted
in interface BulletinBoardServiceRemote
key
- The message being checked. Key has to be different one another if they
represent different meanings.userInfo
- The UserInfo object which contains the specific connection information.
It has to be the one that the execution is performed on behalf, which has to be
the same as the execution where posts this message.post(String, UserInfo)
,
remove(String, UserInfo)
public void remove(java.lang.String key)
Example:
MXServer.getBulletinBoard().post("Invoice.NOOPSYSCODE");
try{
doSomething();
}
finally{
MXServer.getBulletinBoard().remove("Invoice.NOOPSYSCODE");
}
remove
in interface BulletinBoardServiceRemote
key
- The message being posted. Key has to be different one another if they
represent different meanings.userInfo
- The UserInfo object which contains the specific connection information.
It has to be the one that the execution is performed on behalf, which has to be
the same as the execution where posts and reads this message.post(java.lang.String)
public void remove(java.lang.String key, UserInfo userInfo)
Example:
MXServer.getBulletinBoard().post("Invoice.NOOPSYSCODE", UserInfo);
try{
doSomething();
}
finally{
MXServer.getBulletinBoard().remove("Invoice.NOOPSYSCODE", UserInfo);
}
remove
in interface BulletinBoardServiceRemote
key
- The message being posted. Key has to be different one another if they
represent different meanings.post(String, UserInfo)
public java.lang.String getURL()
AppService
getURL
in interface AppServiceRemote
getURL
in interface Service
getURL
in interface ServiceRemote
getURL
in class AppService
public boolean isAppService()
AppService
isAppService
in interface Service
isAppService
in interface ServiceRemote
isAppService
in class AppService
public void restart()
restart
in interface ServiceRemote
restart
in class AppService
public void configure(java.util.Properties configData)
configure
in interface Service
configure
in class AppService
Service
public void init()
init
in interface Service
init
in class AppService
Service
public void destroy()
destroy
in interface Service
destroy
in class AppService
Service
public void setURL(java.lang.String url)
setURL
in interface Service
setURL
in class AppService
public boolean isInitialized()
isInitialized
in interface BulletinBoardServiceRemote