|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.lightdev.app.trec.server.Agent
public abstract class Agent
Standard class all applications should extend when they are intended to be operated as an agent in the context of the Light Development Transparent Remote Computing (TREC) platform.
A TREC server will automatically guard such applications with the Light Development Simple Access Model (SAM) framework. Applications subclassing this abstract base class need to override methods getRequiredRoleIds, initMethodRoleMappings and initRoleNames with an implementation appropriate to secure remote methods exposed by such subclasses to clients.
All public methods of a TREC agent are exposed to clients as remote methods. They may only use data types conforming to the XML-RPC protocol as parameters and return types. See http://ws.apache.org/xmlrpc/types.html for a list of allowed types and refer to the TREC Manual for more details.
See class ServerAdministrator for an example on how to subclass from this abstract base class.
| Field Summary | |
|---|---|
protected com.lightdev.lib.xmlrpc.Communicator |
communicator
|
| Constructor Summary | |
|---|---|
Agent()
create a new instance of an Agent object |
|
| Method Summary | |
|---|---|
abstract void |
destroy()
called when the agent goes out of service. |
String |
getNameForRole(String roleId)
get the role name for a given role id |
abstract String[] |
getRequiredRoleIds()
get ids of all roles required by this agent See class ServerAdministrator for an example of how to do this |
String |
getRoleForMethod(String methodName)
get the id of the role required by the method with a given name |
abstract void |
init()
called automatically when the agent goes into service. |
protected abstract void |
initMethodRoleMappings()
initialize mappings between method names and role ids See class ServerAdministrator for an example of how to do this |
protected abstract void |
initRoleNames()
initialize the role names required by this agent See class ServerAdministrator for an example of how to do this |
protected void |
mapRoleToMethod(String roleIdToMap,
String methodNameToMapRoleTo)
map a role id to a method name Subclasses need to use this method to define the role ids that methods of respective class require. |
void |
setCommunicator(com.lightdev.lib.xmlrpc.Communicator c)
|
protected void |
setNameForRoleId(String roleId,
String roleName)
set the names for the role ids that a subclass of this class defines Subclasses need to use this method to provide a name foreach role id it defines. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected com.lightdev.lib.xmlrpc.Communicator communicator
| Constructor Detail |
|---|
public Agent()
| Method Detail |
|---|
public void setCommunicator(com.lightdev.lib.xmlrpc.Communicator c)
protected void mapRoleToMethod(String roleIdToMap,
String methodNameToMapRoleTo)
Subclasses need to use this method to define the role ids that methods of respective class require.
roleIdToMap - the role id to map to a method namemethodNameToMapRoleTo - the mathod name to map the given role id to
protected void setNameForRoleId(String roleId,
String roleName)
Subclasses need to use this method to provide a name foreach role id it defines.
roleId - a role id defined by a subclass of this classroleName - the name for the given role idpublic abstract void init()
public abstract void destroy()
public String getNameForRole(String roleId)
getNameForRole in interface SAMApplicationroleId - of role to get the name of
public abstract String[] getRequiredRoleIds()
See class ServerAdministrator for an example of how to do this
getRequiredRoleIds in interface SAMApplicationpublic String getRoleForMethod(String methodName)
getRoleForMethod in interface SAMApplicationmethodName - of method to get the required role of
protected abstract void initMethodRoleMappings()
See class ServerAdministrator for an example of how to do this
protected abstract void initRoleNames()
See class ServerAdministrator for an example of how to do this
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||