|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.esri.client.local.LocalService
public abstract class LocalService
Class representing a service on the LocalServer.
Field Summary | |
---|---|
protected String |
_serviceType
|
protected static String |
CREATE_SERVICE_FILE_PATH
|
protected static String |
CREATE_SERVICE_NAME
|
protected static String |
CREATE_SERVICE_TYPE
|
Constructor Summary | |
---|---|
LocalService()
|
Method Summary | |
---|---|
void |
addLocalServiceStartCompleteListener(LocalServiceStartCompleteListener listener)
Add a service start complete listener. |
void |
addLocalServiceStopCompleteListener(LocalServiceStopCompleteListener listener)
Add service stop complete listener. |
protected void |
completeStart()
Override this to perform any service specific tasks at the end of our initialization process. |
protected void |
deleteService(String name)
Delete a service. |
protected void |
failStart(com.esri.client.local.LocalServerError response)
Fail start. |
protected void |
failStart(String error)
Fail start. |
protected void |
fireLocalServiceStartCompleteEvent()
|
String |
getDescription()
Get a description for the service. |
Map<String,String> |
getEndpoints()
Gets the end points for the service. |
String |
getError()
Gets any error; for example an error starting the service. |
LocalServiceStatus |
getStatus()
Gets the status of the service. |
protected String |
getUrl()
Get the URL of the service. |
void |
removeLocalServiceStartCompleteListener(LocalServiceStartCompleteListener listener)
Remove service start complete listener. |
void |
removeLocalServiceStopCompleteListener(LocalServiceStopCompleteListener listener)
Remove service stop complete listener. |
protected org.codehaus.jackson.JsonParser |
sendRequest(URL url,
String data)
Sends a request to a URL. |
protected void |
setError(String error)
Set an error for the service. |
void |
setStatus(LocalServiceStatus status)
Set the status of the service. |
abstract LocalServiceStatus |
start()
Starts the service on the LocalServer and blocks the application till the service has stopped. |
abstract void |
startAsync()
Starts the service on the LocalServer and allows the application to remain responsive while the service is starting. |
protected void |
startAsyncInner()
Asynchronous start up. |
protected LocalServiceStatus |
startInner()
|
LocalServiceStatus |
stop()
Stops the service and blocks the application till the service has stopped. |
void |
stopAsync()
Stops the service and allows the application to remain responsive while the service is starting. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String CREATE_SERVICE_FILE_PATH
protected static final String CREATE_SERVICE_NAME
protected static final String CREATE_SERVICE_TYPE
protected String _serviceType
Constructor Detail |
---|
public LocalService()
Method Detail |
---|
protected String getUrl()
public String getError()
public Map<String,String> getEndpoints()
protected void setError(String error)
error
- The error message.public LocalServiceStatus getStatus()
public void setStatus(LocalServiceStatus status)
status
- Service status to be set.public String getDescription()
public abstract void startAsync()
addLocalServiceStartCompleteListener(LocalServiceStartCompleteListener) method to listen for the start complete event.
Alternatively, use the getStatus()
and getError()
methods the LocalServiceStatus is STARTED before using the service.
start
public abstract LocalServiceStatus start()
- Starts the service on the LocalServer and blocks the application till the service has stopped.
- Returns:
- the local service status
stopAsync
public void stopAsync()
- Stops the service and allows the application to remain responsive while the service is starting.
Use the
addLocalServiceStopCompleteListener(LocalServiceStopCompleteListener)
method to listen for the stop complete event.
stop
public LocalServiceStatus stop()
- Stops the service and blocks the application till the service has stopped.
- Returns:
- the local service status
addLocalServiceStartCompleteListener
public void addLocalServiceStartCompleteListener(LocalServiceStartCompleteListener listener)
- Add a service start complete listener.
- Parameters:
listener
- The listener to add.
removeLocalServiceStartCompleteListener
public void removeLocalServiceStartCompleteListener(LocalServiceStartCompleteListener listener)
- Remove service start complete listener.
- Parameters:
listener
- The listener to remove.
addLocalServiceStopCompleteListener
public void addLocalServiceStopCompleteListener(LocalServiceStopCompleteListener listener)
- Add service stop complete listener.
- Parameters:
listener
- Listener to add.
removeLocalServiceStopCompleteListener
public void removeLocalServiceStopCompleteListener(LocalServiceStopCompleteListener listener)
- Remove service stop complete listener.
- Parameters:
listener
- Listener to remove.
sendRequest
protected org.codehaus.jackson.JsonParser sendRequest(URL url,
String data)
- Sends a request to a URL.
- Parameters:
url
- the URLdata
- the data
- Returns:
- the JSON parser
fireLocalServiceStartCompleteEvent
protected void fireLocalServiceStartCompleteEvent()
failStart
protected void failStart(String error)
- Fail start.
- Parameters:
error
- the error
failStart
protected void failStart(com.esri.client.local.LocalServerError response)
- Fail start.
- Parameters:
response
- the response
startAsyncInner
protected void startAsyncInner()
- Asynchronous start up.
startInner
protected LocalServiceStatus startInner()
deleteService
protected void deleteService(String name)
- Delete a service.
- Parameters:
name
- the name of the service
completeStart
protected void completeStart()
- Override this to perform any service specific tasks at the end of
our initialization process.
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Copyright © 2012. All Rights Reserved.