|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wm.app.b2b.server.Service
public abstract class Service
The Service class contains a collection of methods for gaining access to Objects commonly used by Server services. It may be desirable to subclass Service when creating server-side code, but be aware that there exists the possibility of name-space collisions with your code.
Constructor Summary | |
---|---|
Service()
|
Method Summary | |
---|---|
static void |
desistContext(Session sess)
Removes a session from the cluster database. |
static IData |
doInvoke(NSName name,
IData input)
Invokes any service published on the server with the given input arguments. |
static IData |
doInvoke(NSName name,
Session session,
IData input)
Invokes any service published on the server with the given input arguments. |
static Values |
doInvoke(NSName name,
Session session,
Values input)
Deprecated. Use doInvoke(NSName, Session, IData) |
static Values |
doInvoke(NSName name,
Values input)
Deprecated. Use doInvoke(NSName, IData) |
static IData |
doInvoke(java.lang.String ifc,
java.lang.String svc,
IData input)
Invokes any service published on the server with the given input arguments. |
static IData |
doInvoke(java.lang.String ifc,
java.lang.String svc,
Session session,
IData input)
Invokes any service published on the server with the given input arguments. |
static Values |
doInvoke(java.lang.String ifc,
java.lang.String svc,
Session session,
Values input)
Deprecated. Use doInvoke(String, String, Session, IData) |
static Values |
doInvoke(java.lang.String ifc,
java.lang.String svc,
Values input)
Deprecated. Use doInvoke(String, String, IData) |
static ServiceThread |
doThreadInvoke(NSName svc,
IData input)
Deprecated. Replaced by ServiceThread doThreadInvoke(NSName svc, IData input, long time). Invokes any service published on the server as a thread. |
static ServiceThread |
doThreadInvoke(NSName svc,
IData input,
long time)
Invokes any service published on the server as a thread. |
static ServiceThread |
doThreadInvoke(NSName svc,
Session session,
IData input)
Deprecated. Replaced by ServiceThread doThreadInvoke(NSName svc, Session session, IData input, long time). Invokes any service published on the server as a thread. |
static ServiceThread |
doThreadInvoke(NSName svc,
Session session,
IData input,
long time)
Invokes any service published on the server as a thread. |
static ServiceThread |
doThreadInvoke(java.lang.String ifc,
java.lang.String svc,
IData input)
Deprecated. Replaced by ServiceThread doThreadInvoke(String ifc, String svc, IData input, long time). Invokes any service published on the server as a thread. |
static ServiceThread |
doThreadInvoke(java.lang.String ifc,
java.lang.String svc,
IData input,
long time)
Invokes any service published on the server as a thread. |
static ServiceThread |
doThreadInvoke(java.lang.String ifc,
java.lang.String svc,
Session session,
IData input)
Deprecated. Replaced by ServiceThread doThreadInvoke(String ifc, String svc, Session session, IData input, long time). Invokes any service published on the server as a thread. |
static ServiceThread |
doThreadInvoke(java.lang.String ifc,
java.lang.String svc,
Session session,
IData input,
long time)
Invokes any service published on the server as a thread. |
static java.lang.String |
getBinding(Values input)
Given the input Values, returns the binding name. |
static NSService |
getCallingService()
Returns the service that invoked the service from which getCallingService is being executed. |
static Values |
getClusterMembers()
Returns the members of a cluster. |
static java.lang.String |
getHttpHeaderField(java.lang.String fieldName,
com.wm.net.HttpHeader header)
Returns the string value associated with the specified field name for the specified HttpHeader. |
static HttpHeader |
getHttpRequestHeader()
Returns the HTTP request header. |
static HttpHeader |
getHttpRequestHeader(Values input)
Deprecated. |
static HttpHeader |
getHttpResponseHeader()
Returns the HTTP response header. |
static HttpHeader |
getHttpResponseHeader(Values input)
Deprecated. |
static java.lang.String |
getPackageName(Values input)
Deprecated. |
static byte[] |
getRequest(Values input)
Deprecated. |
static NSService |
getServiceEntry()
Given the input Values, returns the NSService currently being invoked. |
static NSService |
getServiceEntry(Values input)
Deprecated. |
static Session |
getSession()
Returns the Session associated with the current thread. |
static java.lang.String |
getTemplate(Values input)
Deprecated. |
static java.lang.String |
getTemplateType(Values input)
Given the input Values, returns the output template type. |
static User |
getUser()
Returns the User controlling the session associated with the current thread. |
static User |
getUser(Session session)
Given the session object, return its controlling User. |
static boolean |
hasErrors(Values v)
Deprecated. |
static boolean |
isClusterAware()
Determines if the server participates in a cluster. |
static void |
setBinding(Values input,
java.lang.String binding)
Given the input Values, sets the binding name. |
static void |
setResponse(Values input,
byte[] response)
Given the input Values, sets the raw response. |
static void |
setTemplate(Values input,
java.lang.String template)
Deprecated. |
static void |
setTemplateType(Values input,
java.lang.String temptype)
Given the input Values, sets the output template type. |
static Values |
throwError(java.lang.String msg)
Deprecated. |
static Values |
throwError(java.lang.Throwable e)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Service()
Method Detail |
---|
public static boolean isClusterAware()
public static void desistContext(Session sess)
public static Values getClusterMembers()
public static Session getSession()
public static NSService getServiceEntry()
public static NSService getServiceEntry(Values input)
public static NSService getCallingService()
Note: After you execute getCallingService, you can use toString() on the returned NSService object to get a String containing the service's fully qualified service name (i.e., folder:serviceName).
public static java.lang.String getHttpHeaderField(java.lang.String fieldName, com.wm.net.HttpHeader header)
fieldName
- Field nameheader
- HTTP header name
public static HttpHeader getHttpRequestHeader(Values input)
public static HttpHeader getHttpRequestHeader()
public static HttpHeader getHttpResponseHeader(Values input)
public static HttpHeader getHttpResponseHeader()
public static java.lang.String getTemplate(Values input)
public static java.lang.String getTemplateType(Values input)
public static java.lang.String getBinding(Values input)
public static byte[] getRequest(Values input)
public static void setTemplate(Values input, java.lang.String template)
public static void setTemplateType(Values input, java.lang.String temptype)
public static void setResponse(Values input, byte[] response)
public static void setBinding(Values input, java.lang.String binding)
public static java.lang.String getPackageName(Values input)
public static User getUser()
public static User getUser(Session session)
public static Values throwError(java.lang.Throwable e)
public static Values throwError(java.lang.String msg)
public static boolean hasErrors(Values v)
public static Values doInvoke(java.lang.String ifc, java.lang.String svc, Values input) throws java.lang.Exception
doInvoke(String, String, IData)
ifc
- Folder namesvc
- Service nameinput
- Input values for service
java.lang.Exception
public static IData doInvoke(java.lang.String ifc, java.lang.String svc, IData input) throws java.lang.Exception
ifc
- Folder namesvc
- Service nameinput
- Input values for service
java.lang.Exception
public static Values doInvoke(java.lang.String ifc, java.lang.String svc, Session session, Values input) throws java.lang.Exception
doInvoke(String, String, Session, IData)
ifc
- Folder name.svc
- Service name.session
- Current session object.input
- Input values for service.
java.lang.Exception
public static IData doInvoke(java.lang.String ifc, java.lang.String svc, Session session, IData input) throws java.lang.Exception
ifc
- Folder name.svc
- Service name.input
- Input values for service.
java.lang.Exception
public static Values doInvoke(NSName name, Values input) throws java.lang.Exception
doInvoke(NSName, IData)
name
- Fully-qualified service name (folder:service).input
- Input values for service.
java.lang.Exception
public static IData doInvoke(NSName name, IData input) throws java.lang.Exception
name
- Fully-qualified service name (folder:service).input
- Input values for service.
java.lang.Exception
public static Values doInvoke(NSName name, Session session, Values input) throws java.lang.Exception
doInvoke(NSName, Session, IData)
name
- Fully-qualified service name (folder:service).session
- Current session object.input
- Input values for service.
java.lang.Exception
public static IData doInvoke(NSName name, Session session, IData input) throws java.lang.Exception
name
- Fully-qualified service name (folder:service).session
- Current session object.input
- Input values for service.
java.lang.Exception
public static ServiceThread doThreadInvoke(java.lang.String ifc, java.lang.String svc, IData input)
Invokes any service published on the server as a thread.
Call getIData() on the resulting ServiceThread object to force a join.
ifc
- Folder name.svc
- Service name.input
- Input values for service.
public static ServiceThread doThreadInvoke(java.lang.String ifc, java.lang.String svc, IData input, long time) throws ISRuntimeException
Invokes any service published on the server as a thread.
Call getIData() on the resulting ServiceThread object to force a join. If you specify a non-zero value for the time parameter and you do not want the internal invoke manager to retry the calling service, you must catch the ISRuntimeException that will be thrown if a thread is not available in the specified amount of time.
For example, suppose that a service updates a database and then calls doThreadInvoke(). If an ISRuntimeException is thrown but is not caught, the entire service, including the database update, may be repeated. When calling doThreadInvoke(), you must catch ISRuntimeException. If you want the calling service to be retried, then you can re-throw the ISRuntimeException. In all other cases, throw a new ServiceException that wraps the ISRuntimeException.
ifc
- Folder name.svc
- Service name.input
- Input values for service.time
- Length of time (in milliseconds ) to wait for a thread. Specify zero to wait indefinitely. Specify a negative value to return immediately. If a thread is not available within the specified time, an ISRuntimeException is thrown.
ISRuntimeException
- thrown if no thread is available within specified time.public static ServiceThread doThreadInvoke(java.lang.String ifc, java.lang.String svc, Session session, IData input)
Invokes any service published on the server as a thread.
Call getIData() on the resulting ServiceThread object to force a join.
ifc
- Folder name.svc
- Service name.session
- Current session object.input
- Input values for service.
public static ServiceThread doThreadInvoke(java.lang.String ifc, java.lang.String svc, Session session, IData input, long time) throws ISRuntimeException
Invokes any service published on the server as a thread.
Call getIData() on the resulting ServiceThread object to force a join. If you specify a non-zero value for the time parameter and you do not want the internal invoke manager to retry the calling service, you must catch the ISRuntimeException that will be thrown if a thread is not available in the specified amount of time.
For example, suppose that a service updates a database and then calls doThreadInvoke(). If an ISRuntimeException is thrown but is not caught, the entire service, including the database update, may be repeated. When calling doThreadInvoke(), you must catch ISRuntimeException. If you want the calling service to be retried, then you can re-throw the ISRuntimeException. In all other cases, throw a new ServiceException that wraps the ISRuntimeException.
ifc
- Folder name.svc
- Service name.session
- Current session object.input
- Input values for service.time
- Length of time (in milliseconds ) to wait for a thread. Specify zero to wait indefinitely. Specify a negative value to return immediately. If a thread is not available within the specified time, an ISRuntimeException is thrown.
ISRuntimeException
- thrown if no thread is available within specified time.public static ServiceThread doThreadInvoke(NSName svc, IData input)
Invokes any service published on the server as a thread.
Call getIData() on the resulting ServiceThread object to force a join.
svc
- Fully qualified service name (folder:service).input
- Input values for service.
public static ServiceThread doThreadInvoke(NSName svc, IData input, long time) throws ISRuntimeException
Invokes any service published on the server as a thread.
Call getIData() on the resulting ServiceThread object to force a join. If you specify a non-zero value for the time parameter and you do not want the internal invoke manager to retry the calling service, you must catch the ISRuntimeException that will be thrown if a thread is not available in the specified amount of time.
For example, suppose that a service updates a database and then calls doThreadInvoke(). If an ISRuntimeException is thrown but is not caught, the entire service, including the database update, may be repeated. When calling doThreadInvoke(), you must catch ISRuntimeException. If you want the calling service to be retried, then you can re-throw the ISRuntimeException. In all other cases, throw a new ServiceException that wraps the ISRuntimeException.
svc
- Fully qualified service name (folder:service).input
- Input values for service.time
- Length of time (in milliseconds ) to wait for a thread. Specify zero to wait indefinitely. Specify a negative value to return immediately. If a thread is not available within the specified time, an ISRuntimeException is thrown.
ISRuntimeException
- thrown if no thread is available within specified time.public static ServiceThread doThreadInvoke(NSName svc, Session session, IData input)
Invokes any service published on the server as a thread.
Call getIData() on the resulting ServiceThread object to force a join.
svc
- Fully qualified service name (folder:service).session
- Current session object.input
- Input values for service.
public static ServiceThread doThreadInvoke(NSName svc, Session session, IData input, long time) throws ISRuntimeException
Invokes any service published on the server as a thread.
Call getIData() on the resulting ServiceThread object to force a join. If you specify a non-zero value for the time parameter and you do not want the internal invoke manager to retry the calling service, you must catch the ISRuntimeException that will be thrown if a thread is not available in the specified amount of time.
For example, suppose that a service updates a database and then calls doThreadInvoke(). If an ISRuntimeException is thrown but is not caught, the entire service, including the database update, may be repeated. When calling doThreadInvoke(), you must catch ISRuntimeException. If you want the calling service to be retried, then you can re-throw the ISRuntimeException. In all other cases, throw a new ServiceException that wraps the ISRuntimeException.
svc
- Fully qualified service name (folder:service).session
- Current session object.input
- Input values for service.time
- Length of time (in milliseconds ) to wait for a thread. Specify zero to wait indefinitely. Specify a negative value to return immediately. If a thread is not available within the specified time, an ISRuntimeException is thrown.
ISRuntimeException
- thrown if no thread is available within specified time.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |