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, SQLLOGGERappenderPrefix, 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, verifyUserequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetName, isSingletonServicegetName, isSingletonServicegetNamepublic BulletinBoardService()
throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic BulletinBoardService(MXServer mxServer) throws java.rmi.RemoteException
mxServer - -- the "Server Environment" this Service is being
created in.java.rmi.RemoteExceptionpublic BulletinBoardService(java.lang.String url,
MXServer mxServer)
throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic 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 BulletinBoardServiceRemotekey - 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 BulletinBoardServiceRemotekey - 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 BulletinBoardServiceRemotekey - 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 BulletinBoardServiceRemotekey - 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 BulletinBoardServiceRemotekey - 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 BulletinBoardServiceRemotekey - The message being posted. Key has to be different one another if they
represent different meanings.post(String, UserInfo)public java.lang.String getURL()
AppServicegetURL in interface AppServiceRemotegetURL in interface ServicegetURL in interface ServiceRemotegetURL in class AppServicepublic boolean isAppService()
AppServiceisAppService in interface ServiceisAppService in interface ServiceRemoteisAppService in class AppServicepublic void restart()
restart in interface ServiceRemoterestart in class AppServicepublic void configure(java.util.Properties configData)
configure in interface Serviceconfigure in class AppServiceServicepublic void init()
init in interface Serviceinit in class AppServiceServicepublic void destroy()
destroy in interface Servicedestroy in class AppServiceServicepublic void setURL(java.lang.String url)
setURL in interface ServicesetURL in class AppServicepublic boolean isInitialized()
isInitialized in interface BulletinBoardServiceRemote