|
Nokia Extensions for JSR-257 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.nokia.nfc.llcp.LLCPManager
The LLCPManager
class is used for managing LLCP related listeners.
Constructor Summary | |
protected |
LLCPManager()
Creates a LLCPManager instance. |
Method Summary | |
void |
addErrorRecoveryListener(ErrorRecoveryListener l)
Adds a ErrorRecoveryListener to be notified about LLCP error
recovery related events. |
void |
addLinkListener(LLCPLinkListener l)
Adds a LLCPLinkListener to be notified about LLCP link
related events. |
static LLCPManager |
getInstance()
Returns a LLCPManager instance. |
void |
removeErrorRecoveryListener(ErrorRecoveryListener l)
Removes the specified ErrorRecoveryListener so that it will
not be notified about LLCP error recovery related events. |
void |
removeLinkListener(LLCPLinkListener l)
Removes the specified LLCPLinkListener so that it will
not be notified about LLCP link related events. |
void |
startListening(byte type,
byte pid,
LLCPConnectionListener listener)
Start listening for a connection. |
void |
stopListening(byte type,
byte pid,
LLCPConnectionListener listener)
Stops listening for a connection. |
Constructor Detail |
protected LLCPManager() throws java.io.IOException
Method Detail |
public static final LLCPManager getInstance() throws java.io.IOException
LLCPManager
instance.
LLCPManager
instance.
java.io.IOException
- if failed to create the instance.public void addLinkListener(LLCPLinkListener l)
LLCPLinkListener
to be notified about LLCP link
related events. The call will be ignored if the listener has already
been added. Multiple listeners are allowed and the notifications
must be sent to all of them.
l
- the listener object to add.
java.lang.NullPointerException
- if the parameter l
is null
.public void removeLinkListener(LLCPLinkListener l)
LLCPLinkListener
so that it will
not be notified about LLCP link related events. The call will be
ignored if the specified listener has not been added using addLinkListener(LLCPLinkListener)
.
l
- the listener object to remove.
java.lang.NullPointerException
- if the parameter l
is null
.public void addErrorRecoveryListener(ErrorRecoveryListener l)
ErrorRecoveryListener
to be notified about LLCP error
recovery related events. The call will be ignored if the listener has already
been added. Multiple listeners are allowed and the notifications
must be sent to all of them.
l
- the listener object to add.
java.lang.NullPointerException
- if the parameter l
is null
.public void removeErrorRecoveryListener(ErrorRecoveryListener l)
ErrorRecoveryListener
so that it will
not be notified about LLCP error recovery related events. The call will be
ignored if the specified listener has not been added using addErrorRecoveryListener(ErrorRecoveryListener)
.
l
- the listener object to remove.
java.lang.NullPointerException
- if the parameter l
is null
.public void startListening(byte type, byte pid, LLCPConnectionListener listener)
Start listening for a connection. Once a connection has been opened
the LLCPConnectionListener.connectionOpened(LLCPConnection)
method
will be called.
Valid values for parameter type
are LLCPConnection.TYPE_1
and LLCPConnection.TYPE_2
.
The implementation may limit the number of applications listening for
connections for the specified protocol identifier. If such an limit exists
and another application is already listening for a connection, then this
method may throw an IllegalStateException
.
type
- type of the connection.pid
- the protocol identifier.listener
- the listener that will be notified once a connection has been opened.
java.lang.NullPointerException
- if the listener
is null
.
java.lang.IllegalStateException
- if already listening to the connection.
java.lang.IllegalStateException
- if the implementation doesn't allow listening
to connections using the specified protocol.
java.lang.IllegalArgumentException
- if the parameters are invalid.public void stopListening(byte type, byte pid, LLCPConnectionListener listener)
Stops listening for a connection. The parameters must match the parameters given when started to listen for a connection.
If listening to the specified connection hasn't started then this method will not do anything.
type
- type of the connection.pid
- the protocol identifier.listener
- the associated listener object.
java.lang.IllegalArgumentException
- if the parameters are invalid.
java.lang.NullPointerException
- if listener
is null
.
|
Nokia Extensions for JSR-257 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |