Public Member Functions | |
final void | addAttachListener (AttachListener l) |
final void | addDetachListener (DetachListener l) |
final void | addServerConnectListener (ServerConnectListener l) |
final void | addServerDisconnectListener (ServerDisconnectListener l) |
final void | close () throws PhidgetException |
Vector | getPhidgets () |
final native String | getServerAddress () throws PhidgetException |
final native String | getServerID () throws PhidgetException |
final native int | getServerPort () throws PhidgetException |
final native boolean | isAttached () throws PhidgetException |
final native boolean | isAttachedToServer () throws PhidgetException |
Manager () throws PhidgetException | |
final void | open () throws PhidgetException |
final void | open (String ipAddress, int port, String password) throws PhidgetException |
final void | open (String ipAddress, int port) throws PhidgetException |
final void | open (String serverID, String password) throws PhidgetException |
final void | open (String serverID) throws PhidgetException |
final void | removeAttachListener (AttachListener l) |
final void | removeDetachListener (DetachListener l) |
final void | removeServerConnectListener (ServerConnectListener l) |
final void | removeServerDisconnectListener (ServerDisconnectListener l) |
String | toString () |
Protected Member Functions | |
void | finalize () throws Throwable |
Static Package Functions | |
[static initializer] | |
Private Member Functions | |
final native long | create () throws PhidgetException |
void | enableEvents (boolean b) |
native void | enableManagerAttachEvents (boolean b) |
native void | enableManagerDetachEvents (boolean b) |
native void | enableServerConnectEvents (boolean b) |
native void | enableServerDisconnectEvents (boolean b) |
void | fireAttach (AttachEvent e) |
void | fireDetach (DetachEvent e) |
void | fireServerConnect (ServerConnectEvent e) |
void | fireServerDisconnect (ServerDisconnectEvent e) |
final native void | nativeClose () throws PhidgetException |
final native void | nativeDelete () throws PhidgetException |
final native void | nativeOpen () throws PhidgetException |
final native void | nativeOpenRemote (String serverID, String pass) throws PhidgetException |
final native void | nativeOpenRemoteIP (String ipAddress, int port, String pass) throws PhidgetException |
Private Attributes | |
LinkedList | attachListeners = new LinkedList() |
LinkedList | detachListeners = new LinkedList() |
long | handle = 0 |
long | nativeAttachHandler = 0 |
long | nativeDetachHandler = 0 |
long | nativeServerConnectHandler = 0 |
long | nativeServerDisconnectHandler = 0 |
Vector | phidgets |
LinkedList | serverConnectListeners = new LinkedList() |
LinkedList | serverDisconnectListeners = new LinkedList() |
This class represents a Phidget Manager. The Phidget manager is a way to keep track of attached phidgets, it will send Attach and Detach events as Phidgets are added and removed fromt the system.
The Phidget manager deals in base Phidget objects. These objects are not actually connected to opened Phidgets but can be used to get serial number, name, version, etc.
Definition at line 24 of file Manager.java.
com.phidgets.Manager.Manager | ( | ) | throws PhidgetException [inline] |
The default constructor. Creating a Phidget Manager object will initialize the attach and detach handlers internally, but open still needs to be called to actually receive event notifications.
Definition at line 69 of file Manager.java.
com.phidgets.Manager.[static initializer] | ( | ) | [inline, static, package] |
final void com.phidgets.Manager.addAttachListener | ( | AttachListener | l | ) | [inline] |
Adds an attach listener. The attach handler is a method that will be called when a Phidget is phisically attached to the system, and has gone through its initalization, and so is ready to be used.
There is no limit on the number of attach handlers that can be registered for a particular Phidget.
l | An implemetation of the AttachListener interface |
Definition at line 225 of file Manager.java.
final void com.phidgets.Manager.addDetachListener | ( | DetachListener | l | ) | [inline] |
Adds a detach listener. The detach handler is a method that will be called when a Phidget is phisically detached from the system, and is no longer available.
There is no limit on the number of detach handlers that can be registered for a particular Phidget.
l | An implemetation of the DetachListener interface |
Definition at line 261 of file Manager.java.
final void com.phidgets.Manager.addServerConnectListener | ( | ServerConnectListener | l | ) | [inline] |
Adds an serverConnect listener. The serverConnect handler is a method that will be called when a connection to a server is made
There is no limit on the number of serverConnect handlers that can be registered for a particular Manager.
l | An implemetation of the ServerConnectListener interface |
Definition at line 296 of file Manager.java.
final void com.phidgets.Manager.addServerDisconnectListener | ( | ServerDisconnectListener | l | ) | [inline] |
Adds an serverDisconnect listener. The serverDisconnect handler is a method that will be called when a connection to a server is terminated.
There is no limit on the number of serverDisconnect handlers that can be registered for a particular Manager.
l | An implemetation of the ServerDisconnectListener interface |
Definition at line 338 of file Manager.java.
final void com.phidgets.Manager.close | ( | ) | throws PhidgetException [inline] |
final native long com.phidgets.Manager.create | ( | ) | throws PhidgetException [private] |
void com.phidgets.Manager.enableEvents | ( | boolean | b | ) | [inline, private] |
Definition at line 206 of file Manager.java.
native void com.phidgets.Manager.enableManagerAttachEvents | ( | boolean | b | ) | [private] |
native void com.phidgets.Manager.enableManagerDetachEvents | ( | boolean | b | ) | [private] |
native void com.phidgets.Manager.enableServerConnectEvents | ( | boolean | b | ) | [private] |
native void com.phidgets.Manager.enableServerDisconnectEvents | ( | boolean | b | ) | [private] |
void com.phidgets.Manager.finalize | ( | ) | throws Throwable [inline, protected] |
Definition at line 369 of file Manager.java.
void com.phidgets.Manager.fireAttach | ( | AttachEvent | e | ) | [inline, private] |
Definition at line 241 of file Manager.java.
void com.phidgets.Manager.fireDetach | ( | DetachEvent | e | ) | [inline, private] |
Definition at line 277 of file Manager.java.
void com.phidgets.Manager.fireServerConnect | ( | ServerConnectEvent | e | ) | [inline, private] |
Definition at line 316 of file Manager.java.
void com.phidgets.Manager.fireServerDisconnect | ( | ServerDisconnectEvent | e | ) | [inline, private] |
Definition at line 358 of file Manager.java.
Vector com.phidgets.Manager.getPhidgets | ( | ) | [inline] |
Returns a list of Phidgets attached to the host computer. This list is updated right before the attach and detach events, and so will be up to date within these events.
Definition at line 404 of file Manager.java.
final native String com.phidgets.Manager.getServerAddress | ( | ) | throws PhidgetException |
Returns the Address of a Phidget Webservice when this Manager was opened as remote. This may be an IP Address or a hostname.
PhidgetException | if this Manager was not opened. |
final native String com.phidgets.Manager.getServerID | ( | ) | throws PhidgetException |
Returns the Server ID of a Phidget Webservice when this Manager was opened as remote. This is an arbitrary server identifier, independant of IP address and Port.
PhidgetException | if this Manager was not opened. |
final native int com.phidgets.Manager.getServerPort | ( | ) | throws PhidgetException |
Returns the Port of a Phidget Webservice when this Manager was opened as remote.
PhidgetException | if this Manager was not opened. |
final native boolean com.phidgets.Manager.isAttached | ( | ) | throws PhidgetException |
Returns the attached status of this Manager.
PhidgetException | If this Manager is not opened. |
final native boolean com.phidgets.Manager.isAttachedToServer | ( | ) | throws PhidgetException |
Returns the network attached status for remotely opened Phidgets. This method returns True or False, depending on whether a connection to the Phidget WebService is open - or not. If this is false for a remote Phidget then the connection is not active - either because a connection has not yet been established, or because the connection was terminated.
PhidgetException | If this Phidget is not opened. |
final native void com.phidgets.Manager.nativeClose | ( | ) | throws PhidgetException [private] |
final native void com.phidgets.Manager.nativeDelete | ( | ) | throws PhidgetException [private] |
final native void com.phidgets.Manager.nativeOpen | ( | ) | throws PhidgetException [private] |
final native void com.phidgets.Manager.nativeOpenRemote | ( | String | serverID, |
String | pass | ||
) | throws PhidgetException [private] |
final native void com.phidgets.Manager.nativeOpenRemoteIP | ( | String | ipAddress, |
int | port, | ||
String | pass | ||
) | throws PhidgetException [private] |
final void com.phidgets.Manager.open | ( | ) | throws PhidgetException [inline] |
Starts the PhidgetManager. This method starts the phidget manager running in the base Phidget21 C library. If attach and detach listeners are to be used, they should be registered before start is called so that no events are missed. Once start is called, the Phidget Manager will be active until close is called.
Definition at line 141 of file Manager.java.
final void com.phidgets.Manager.open | ( | String | ipAddress, |
int | port, | ||
String | password | ||
) | throws PhidgetException [inline] |
Open this Manager remotely and securely, using an IP Address.
This method is the same as open(String ipAddress, int port), except that it specifies a password. This password can be set as a parameter when starting the Phidget Webservice.
Definition at line 151 of file Manager.java.
final void com.phidgets.Manager.open | ( | String | ipAddress, |
int | port | ||
) | throws PhidgetException [inline] |
Open this Manager remotely using an IP Address.
This version of open is network based.
ipAddress | IP Address or hostname of the Phidget Webservice |
port | Port of the Phidget Webservice |
PhidgetException | if the Phidget Webservice cannot be contacted |
Definition at line 165 of file Manager.java.
final void com.phidgets.Manager.open | ( | String | serverID, |
String | password | ||
) | throws PhidgetException [inline] |
Open this Manager remotely and securely, using a Server ID.
This method is the same as open(String serverID), except that it specifies a password. This password can be set as a parameter when starting the Phidget Webservice.
Definition at line 176 of file Manager.java.
final void com.phidgets.Manager.open | ( | String | serverID | ) | throws PhidgetException [inline] |
Open this Manager remotely using a Server ID.
This version of open is network based.
ServerID can be NULL to get a listing of all Phidgets on all Servers
serverID | ServerID of the Phidget Webservice |
Definition at line 190 of file Manager.java.
final void com.phidgets.Manager.removeAttachListener | ( | AttachListener | l | ) | [inline] |
Removes an attach listener. This will remove a previously added attach listener.
Definition at line 235 of file Manager.java.
final void com.phidgets.Manager.removeDetachListener | ( | DetachListener | l | ) | [inline] |
Removes a detach listener. This will remove a previously added detach listener.
Definition at line 271 of file Manager.java.
final void com.phidgets.Manager.removeServerConnectListener | ( | ServerConnectListener | l | ) | [inline] |
Removes an serverConnect listener. This will remove a previously added serverConnect listener.
Definition at line 308 of file Manager.java.
final void com.phidgets.Manager.removeServerDisconnectListener | ( | ServerDisconnectListener | l | ) | [inline] |
Removes an serverDisconnect listener. This will remove a previously added serverDisconnect listener.
Definition at line 350 of file Manager.java.
String com.phidgets.Manager.toString | ( | ) | [inline] |
Return a Sring describing this manager.
Definition at line 394 of file Manager.java.
LinkedList com.phidgets.Manager.attachListeners = new LinkedList() [private] |
Definition at line 214 of file Manager.java.
LinkedList com.phidgets.Manager.detachListeners = new LinkedList() [private] |
Definition at line 250 of file Manager.java.
long com.phidgets.Manager.handle = 0 [private] |
Definition at line 63 of file Manager.java.
long com.phidgets.Manager.nativeAttachHandler = 0 [private] |
Definition at line 215 of file Manager.java.
long com.phidgets.Manager.nativeDetachHandler = 0 [private] |
Definition at line 251 of file Manager.java.
long com.phidgets.Manager.nativeServerConnectHandler = 0 [private] |
Definition at line 287 of file Manager.java.
long com.phidgets.Manager.nativeServerDisconnectHandler = 0 [private] |
Definition at line 329 of file Manager.java.
Vector com.phidgets.Manager.phidgets [private] |
Definition at line 26 of file Manager.java.
LinkedList com.phidgets.Manager.serverConnectListeners = new LinkedList() [private] |
Definition at line 286 of file Manager.java.
LinkedList com.phidgets.Manager.serverDisconnectListeners = new LinkedList() [private] |
Definition at line 328 of file Manager.java.