public abstract class ConnectedServiceBase
extends java.lang.Object
Example: The simplest possible extension class merely forms a connection and specifies it's own common action.
@Sample(name = "connect")
public class Connect extends ConnectedServiceBase {
@Action
public void action() {
System.out.println("currently connected: " + this.isConnected());
}
}
This is provided as an alternative to extending the Connection class directly.
For a very simple connected sample:
| Constructor and Description |
|---|
ConnectedServiceBase() |
| Modifier and Type | Method and Description |
|---|---|
void |
setConnection(Connection connect)
A method for dependency injection of the connection object.
|
boolean |
start()
connects this object, returns true on successful connect
|
boolean |
stop()
disconnects this object and returns true on successful disconnect
|
@Option(name="connection",
type=BasicConnection.class)
public void setConnection(Connection connect)
connect - the connection object to use for this POJOConnection@Before public boolean start()
ConnectionException@After public boolean stop()
ConnectionException