|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.snmp4j.transport.AbstractTransportMapping<A>
public abstract class AbstractTransportMapping<A extends Address>
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.List<TransportListener> |
transportListener
|
| Constructor Summary | |
|---|---|
AbstractTransportMapping()
|
|
| Method Summary | |
|---|---|
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,
TransportStateReference tmStateReference)
|
int |
getMaxInboundMessageSize()
Gets the maximum length of an incoming message that can be successfully processed by this transport mapping implementation. |
abstract java.lang.Class<? extends Address> |
getSupportedAddressClass()
Gets the Address class that is supported by this transport mapping. |
boolean |
isAsyncMsgProcessingSupported()
Returns true if asynchronous (multi-threaded) message
processing may be implemented. |
abstract void |
listen()
Listen for incoming messages. |
void |
removeTransportListener(TransportListener l)
Removes a transport listener. |
abstract void |
sendMessage(A address,
byte[] message,
TransportStateReference tmStateReference)
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.List<TransportListener> transportListener
protected int maxInboundMessageSize
protected boolean asyncMsgProcessingSupported
| Constructor Detail |
|---|
public AbstractTransportMapping()
| Method Detail |
|---|
public abstract java.lang.Class<? extends Address> getSupportedAddressClass()
TransportMappingAddress class that is supported by this transport mapping.
getSupportedAddressClass in interface TransportMapping<A extends Address>Address.
public abstract void sendMessage(A address,
byte[] message,
TransportStateReference tmStateReference)
throws java.io.IOException
TransportMapping
sendMessage in interface TransportMapping<A extends Address>address - an Address instance denoting the target address.message - the whole message as an array of bytes.tmStateReference - the (optional) transport model state reference as defined by
RFC 5590 section 6.1.
java.io.IOException - if any underlying IO operation fails.public void addTransportListener(TransportListener l)
TransportMapping
addTransportListener in interface TransportMapping<A extends Address>l - a TransportListener instance.public void removeTransportListener(TransportListener l)
TransportMappingTransportListener.
removeTransportListener in interface TransportMapping<A extends Address>l - a TransportListener instance.
protected void fireProcessMessage(Address address,
java.nio.ByteBuffer buf,
TransportStateReference tmStateReference)
public abstract void close()
throws java.io.IOException
TransportMapping
close in interface TransportMapping<A extends Address>java.io.IOException - if any IO operation for the close fails.
public abstract void listen()
throws java.io.IOException
TransportMappingTransportMapping.sendMessage(A, byte[], org.snmp4j.TransportStateReference) is called for the
first time.
listen in interface TransportMapping<A extends Address>java.io.IOException - if an IO operation exception occurs while starting the listener.public int getMaxInboundMessageSize()
TransportMapping
getMaxInboundMessageSize in interface TransportMapping<A extends Address>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, java.nio.ByteBuffer, org.snmp4j.TransportStateReference)
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, java.nio.ByteBuffer, org.snmp4j.TransportStateReference)
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-2011 Frank Fock (SNMP4J.org) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||