org.apache.directory.server.protocol.shared.transport
Class AbstractTransport

java.lang.Object
  extended by org.apache.directory.server.protocol.shared.transport.AbstractTransport
All Implemented Interfaces:
Transport
Direct Known Subclasses:
TcpTransport, UdpTransport

public abstract class AbstractTransport
extends java.lang.Object
implements Transport


Field Summary
protected  org.apache.mina.core.service.IoAcceptor acceptor
          The IoAcceptor used to accept requests
protected static int DEFAULT_BACKLOG_NB
          The default backlog queue size
protected static int DEFAULT_NB_THREADS
          The default number of threads
protected static java.lang.String LOCAL_HOST
          The default hostname
 
Constructor Summary
AbstractTransport()
          Creates an instance of an Abstract Transport class.
AbstractTransport(int port)
          Creates an instance of an Abstract Transport class, using localhost and port.
AbstractTransport(int port, int nbThreads)
          Creates an instance of an Abstract Transport class, using localhost and port.
AbstractTransport(int port, int nbThreads, int backLog)
          Creates an instance of the AbstractTransport class on LocalHost
AbstractTransport(java.lang.String address, int port)
          Creates an instance of an Abstract Transport class, using the given address and port.
AbstractTransport(java.lang.String address, int port, int nbThreads, int backLog)
          Creates an instance of the AbstractTransport class
 
Method Summary
 void enableSSL(boolean sslEnabled)
          Enable or disable SSL
abstract  org.apache.mina.core.service.IoAcceptor getAcceptor()
          
 java.lang.String getAddress()
          
 int getBackLog()
          
 boolean getEnableSSL()
           
 int getNbThreads()
          Set the IoAcceptor
 int getPort()
          Gets the port for this service.
abstract  void init()
          Initialize the Acceptor if needed
 boolean isSSLEnabled()
           
 void setAddress(java.lang.String address)
          Stores the Address in this transport
 void setBackLog(int backLog)
          Set the size of the messages queue waiting for the acceptor to be ready.
 void setEnableSSL(boolean sslEnabled)
          Enable or disable SSL
 void setNbThreads(int nbThreads)
          Set the number of processing threads for the acceptor
 void setPort(int port)
          Sets the port for this service.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

acceptor

protected org.apache.mina.core.service.IoAcceptor acceptor
The IoAcceptor used to accept requests


DEFAULT_BACKLOG_NB

protected static final int DEFAULT_BACKLOG_NB
The default backlog queue size

See Also:
Constant Field Values

LOCAL_HOST

protected static final java.lang.String LOCAL_HOST
The default hostname

See Also:
Constant Field Values

DEFAULT_NB_THREADS

protected static final int DEFAULT_NB_THREADS
The default number of threads

See Also:
Constant Field Values
Constructor Detail

AbstractTransport

public AbstractTransport()
Creates an instance of an Abstract Transport class.


AbstractTransport

public AbstractTransport(int port)
Creates an instance of an Abstract Transport class, using localhost and port.

Parameters:
port - The port

AbstractTransport

public AbstractTransport(int port,
                         int nbThreads)
Creates an instance of an Abstract Transport class, using localhost and port.

Parameters:
port - The port
nbThreads - The number of threads to create in the acceptor

AbstractTransport

public AbstractTransport(java.lang.String address,
                         int port)
Creates an instance of an Abstract Transport class, using the given address and port.

Parameters:
address - The address
port - The port

AbstractTransport

public AbstractTransport(int port,
                         int nbThreads,
                         int backLog)
Creates an instance of the AbstractTransport class on LocalHost

Parameters:
tcpPort - The port
nbThreads - The number of threads to create in the acceptor
backlog - The queue size for incoming messages, waiting for the acceptor to be ready

AbstractTransport

public AbstractTransport(java.lang.String address,
                         int port,
                         int nbThreads,
                         int backLog)
Creates an instance of the AbstractTransport class

Parameters:
address - The address
tcpPort - The port
nbThreads - The number of threads to create in the acceptor
backlog - The queue size for incoming messages, waiting for the acceptor to be ready
Method Detail

init

public abstract void init()
Initialize the Acceptor if needed

Specified by:
init in interface Transport

getPort

public int getPort()
Gets the port for this service.

Specified by:
getPort in interface Transport
Returns:
the port for this service

setPort

public void setPort(int port)
Sets the port for this service.

Specified by:
setPort in interface Transport
Parameters:
port - the port for this service

getAddress

public java.lang.String getAddress()

Specified by:
getAddress in interface Transport
Returns:
The associated Address

setAddress

public void setAddress(java.lang.String address)
Stores the Address in this transport

Specified by:
setAddress in interface Transport
Parameters:
address - the Address to store

getAcceptor

public abstract org.apache.mina.core.service.IoAcceptor getAcceptor()

Specified by:
getAcceptor in interface Transport
Returns:
The associated IoAcceptor

getNbThreads

public int getNbThreads()
Set the IoAcceptor

Specified by:
getNbThreads in interface Transport
Returns:
The number of processing threads for this acceptor

setNbThreads

public void setNbThreads(int nbThreads)
Set the number of processing threads for the acceptor

Specified by:
setNbThreads in interface Transport
Parameters:
nbThreads - The number of threads to create in the acceptor

getBackLog

public int getBackLog()

Specified by:
getBackLog in interface Transport
Returns:
The number of messages stored into the backlog when the acceptor is being busy processing the current messages

setBackLog

public void setBackLog(int backLog)
Set the size of the messages queue waiting for the acceptor to be ready.

Specified by:
setBackLog in interface Transport
Parameters:
backLog - The queue size

setEnableSSL

public void setEnableSSL(boolean sslEnabled)
Enable or disable SSL

Specified by:
setEnableSSL in interface Transport
Parameters:
enableSSL - if true, SSL is enabled.

enableSSL

public void enableSSL(boolean sslEnabled)
Enable or disable SSL

Specified by:
enableSSL in interface Transport
Parameters:
enableSSL - if true, SSL is enabled.

isSSLEnabled

public boolean isSSLEnabled()
Specified by:
isSSLEnabled in interface Transport
Returns:
true id SSL is enabled for this transport

getEnableSSL

public boolean getEnableSSL()
Returns:
true id SSL is enabled for this transport

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.