|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.snmp4j.transport.AbstractTransportMapping
public abstract class AbstractTransportMapping
The AbstractTransportMapping
provides an abstract
implementation for the message dispatcher list and the maximum inbound
message size.
Field Summary | |
---|---|
protected boolean |
asyncMsgProcessingSupported
|
protected int |
maxInboundMessageSize
|
protected java.util.Vector |
transportListener
|
Constructor Summary | |
---|---|
AbstractTransportMapping()
|
Method Summary | |
---|---|
void |
addMessageDispatcher(MessageDispatcher dispatcher)
Adds a message dispatcher to the transport. |
void |
addTransportListener(TransportListener l)
Adds a transport listener to the transport. |
abstract void |
close()
Closes the transport an releases all bound resources synchronously. |
protected void |
fireProcessMessage(Address address,
java.nio.ByteBuffer buf)
|
int |
getMaxInboundMessageSize()
Gets the maximum length of an incoming message that can be successfully processed by this transport mapping implementation. |
abstract java.lang.Class |
getSupportedAddressClass()
Gets the Address class that is this transport mapping
supports. |
boolean |
isAsyncMsgProcessingSupported()
Returns true if asynchronous (multi-threaded) message
processing may be implemented. |
abstract void |
listen()
Listen for incoming messages. |
void |
removeMessageDispatcher(MessageDispatcher dispatcher)
Removes a message dispatcher. |
void |
removeTransportListener(TransportListener l)
Removes a transport listener. |
abstract void |
sendMessage(Address address,
byte[] message)
Sends a message to the supplied address using this transport. |
void |
setAsyncMsgProcessingSupported(boolean asyncMsgProcessingSupported)
Specifies whether this transport mapping has to support asynchronous messages processing or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.snmp4j.TransportMapping |
---|
getListenAddress, isListening |
Field Detail |
---|
protected java.util.Vector transportListener
protected int maxInboundMessageSize
protected boolean asyncMsgProcessingSupported
Constructor Detail |
---|
public AbstractTransportMapping()
Method Detail |
---|
public abstract java.lang.Class getSupportedAddressClass()
TransportMapping
Address
class that is this transport mapping
supports.
getSupportedAddressClass
in interface TransportMapping
Address
.public abstract void sendMessage(Address address, byte[] message) throws java.io.IOException
TransportMapping
sendMessage
in interface TransportMapping
address
- an Address
instance denoting the target address.message
- the whole message as an array of bytes.
java.io.IOException
public void addMessageDispatcher(MessageDispatcher dispatcher)
TransportMapping
addMessageDispatcher
in interface TransportMapping
dispatcher
- a MessageDispatcher instance.MessageDispatcherImpl
public void removeMessageDispatcher(MessageDispatcher dispatcher)
TransportMapping
removeMessageDispatcher
in interface TransportMapping
dispatcher
- a previously added MessageDispatcher instance.TransportMapping.addMessageDispatcher(org.snmp4j.MessageDispatcher)
public void addTransportListener(TransportListener l)
TransportMapping
addTransportListener
in interface TransportMapping
l
- a TransportListener
instance.public void removeTransportListener(TransportListener l)
TransportMapping
TransportListener
.
removeTransportListener
in interface TransportMapping
l
- a TransportListener
instance.protected void fireProcessMessage(Address address, java.nio.ByteBuffer buf)
public abstract void close() throws java.io.IOException
TransportMapping
close
in interface TransportMapping
java.io.IOException
public abstract void listen() throws java.io.IOException
TransportMapping
TransportMapping.sendMessage(org.snmp4j.smi.Address, byte[])
is called for the
first time.
listen
in interface TransportMapping
java.io.IOException
public int getMaxInboundMessageSize()
TransportMapping
getMaxInboundMessageSize
in interface TransportMapping
public boolean isAsyncMsgProcessingSupported()
true
if asynchronous (multi-threaded) message
processing may be implemented. The default is true
.
false
is returned the
MessageDispatcher.processMessage(org.snmp4j.TransportMapping, org.snmp4j.smi.Address, org.snmp4j.asn1.BERInputStream)
method must not return before the message has been entirely processed.public void setAsyncMsgProcessingSupported(boolean asyncMsgProcessingSupported)
asyncMsgProcessingSupported
- if false
the MessageDispatcher.processMessage(org.snmp4j.TransportMapping, org.snmp4j.smi.Address, org.snmp4j.asn1.BERInputStream)
method must not return before the message has been entirely processed,
because the incoming message buffer is not copied before the message
is being processed. If true
the message buffer is copied
for each call, so that the message processing can be implemented
asynchronously.
|
Copyright 2005-2010 Frank Fock (SNMP4J.org) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |