public class CurrentService extends Object
Session.| Modifier and Type | Field and Description |
|---|---|
protected Session |
session
The session this
CurrentService belongs to. |
| Modifier | Constructor and Description |
|---|---|
protected |
CurrentService(Session session)
Creates a new
CurrentService instance belonging to the given Session. |
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Retrieves the name of the current service.
|
Service |
getService()
Retrieves the current service.
|
boolean |
process(int cmd,
Buffer buffer)
Processes a service request.
|
void |
set(Service service,
String name,
boolean start)
Sets the current service and its name, and optionally starts the service.
|
void |
start()
Starts the current service.
|
protected final Session session
CurrentService belongs to.protected CurrentService(Session session)
CurrentService instance belonging to the given Session.session - Session the instance belongs topublic String getName()
null if none is setpublic Service getService()
null if none is setpublic void set(Service service, String name, boolean start)
service - Service to setname - Name of the service (the name of the ServiceFactory that created it)start - whether to start the servicepublic void start()
public boolean process(int cmd,
Buffer buffer)
throws Exception
cmd - the commandbuffer - the data received with the commandtrue if a current service is set, false if no current service existsException - when the current service failsCopyright © 2008–2024 The Apache Software Foundation. All rights reserved.