Top Description Inners Fields Constructors Methods
org.glassfish.grizzly

public abstract Class AbstractSocketConnectorHandler

extends Object
implements SocketConnectorHandler
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.SocketConnectorHandler, org.glassfish.grizzly.ConnectorHandler
Known Direct Subclasses
org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler, org.glassfish.grizzly.nio.transport.UDPNIOConnectorHandler
Imports
java.net.InetSocketAddress, .SocketAddress, java.util.LinkedList, .List, org.glassfish.grizzly.impl.FutureImpl, .SafeFutureImpl

Abstract class simplifies the implementation of SocketConnectorHandler interface by pre-implementing some of its methods.
Author
Alexey Stashok

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class

Field Summary

Modifier and TypeField and Description
protected final List<ConnectionProbe>
private Processor<E extends Context>
private ProcessorSelector
protected final Transport

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addMonitoringProbe(ConnectionProbe probe)

Add the ConnectionProbe, which will be notified about Connection life-cycle events.

public GrizzlyFuture<Connection<L>>
connect(String host, int port)

Implements org.glassfish.grizzly.SocketConnectorHandler.connect.

Creates, initializes and connects socket to the specific remote host and port and returns Connection, representing socket.

public GrizzlyFuture<Connection<L>>
connect(SocketAddress remoteAddress)

Implements org.glassfish.grizzly.ConnectorHandler.connect.

Creates, initializes and establishes Connection to the specific remoteAddress.

public void
public GrizzlyFuture<Connection<L>>
connect(SocketAddress remoteAddress, SocketAddress localAddress)

Implements org.glassfish.grizzly.ConnectorHandler.connect.

Creates, initializes Connection, binds it to the specific local and remote remoteAddress.

public void
connect(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection<L>> completionHandler)

Implements org.glassfish.grizzly.ConnectorHandler.connect.

Creates, initializes Connection, binds it to the specific local and remote remoteAddress.

protected abstract FutureImpl<Connection<L>>
connectAsync(final SocketAddress remoteAddress, final SocketAddress localAddress, final CompletionHandler<Connection<L>> completionHandler, final boolean needFuture)

public ConnectionProbe[]

Returns:

the ConnectionProbe, which are registered on the Connection.
getMonitoringProbes
()

Get the ConnectionProbe, which are registered on the Connection.

public Processor<E extends Context>

Returns:

the default Processor to process IOEvent, occurring on connection phase.
getProcessor
()

Get the default Processor to process IOEvent, occurring on connection phase.

public ProcessorSelector

Returns:

the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.
getProcessorSelector
()

Gets the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.

protected FutureImpl<Connection<L>>
makeCancellableFuture(final Connection<L> connection)

protected void
preConfigure(Connection<L>
Connection to pre-configure.
connection
)

Pre-configures Connection object before actual connecting phase will be started.

public boolean

Returns:

true if probe was in the list and is now removed
removeMonitoringProbe
(ConnectionProbe probe)

Remove the ConnectionProbe.

public void
setProcessor(Processor<E extends Context>
the default Processor to process IOEvent, occurring on connection phase.
processor
)

Set the default Processor to process IOEvent, occurring on connection phase.

public void
setProcessorSelector(ProcessorSelector
the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.
processorSelector
)

Sets the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

probesback to summary
protected final List<ConnectionProbe> probes
processorback to summary
private Processor<E extends Context> processor
processorSelectorback to summary
private ProcessorSelector processorSelector
transportback to summary
protected final Transport transport

Constructor Detail

AbstractSocketConnectorHandlerback to summary
public AbstractSocketConnectorHandler(Transport transport)

Method Detail

addMonitoringProbeback to summary
public void addMonitoringProbe(ConnectionProbe probe)

Add the ConnectionProbe, which will be notified about Connection life-cycle events.

Parameters
probe:ConnectionProbe

the ConnectionProbe.

connectback to summary
public GrizzlyFuture<Connection<L>> connect(String host, int port)

Implements org.glassfish.grizzly.SocketConnectorHandler.connect.

Doc from org.glassfish.grizzly.SocketConnectorHandler.connect.

Creates, initializes and connects socket to the specific remote host and port and returns Connection, representing socket.

Annotations
@Override
connectback to summary
public GrizzlyFuture<Connection<L>> connect(SocketAddress remoteAddress)

Implements org.glassfish.grizzly.ConnectorHandler.connect.

Doc from org.glassfish.grizzly.ConnectorHandler.connect.

Creates, initializes and establishes Connection to the specific remoteAddress.

Annotations
@Override
connectback to summary
public void connect(SocketAddress remoteAddress, CompletionHandler<Connection<L>> completionHandler)

Implements org.glassfish.grizzly.ConnectorHandler.connect, org.glassfish.grizzly.ConnectorHandler.connect.

Annotations
@Override
connectback to summary
public GrizzlyFuture<Connection<L>> connect(SocketAddress remoteAddress, SocketAddress localAddress)

Implements org.glassfish.grizzly.ConnectorHandler.connect.

Doc from org.glassfish.grizzly.ConnectorHandler.connect.

Creates, initializes Connection, binds it to the specific local and remote remoteAddress.

Annotations
@Override
connectback to summary
public void connect(SocketAddress remoteAddress, SocketAddress localAddress, CompletionHandler<Connection<L>> completionHandler)

Implements org.glassfish.grizzly.ConnectorHandler.connect.

Doc from org.glassfish.grizzly.ConnectorHandler.connect.

Creates, initializes Connection, binds it to the specific local and remote remoteAddress.

Annotations
@Override
connectAsyncback to summary
protected abstract FutureImpl<Connection<L>> connectAsync(final SocketAddress remoteAddress, final SocketAddress localAddress, final CompletionHandler<Connection<L>> completionHandler, final boolean needFuture)
getMonitoringProbesback to summary
public ConnectionProbe[] getMonitoringProbes()

Get the ConnectionProbe, which are registered on the Connection. Please note, it's not appropriate to modify the returned array's content. Please use addMonitoringProbe(org.glassfish.grizzly.ConnectionProbe) and removeMonitoringProbe(org.glassfish.grizzly.ConnectionProbe) instead.

Returns:ConnectionProbe[]

the ConnectionProbe, which are registered on the Connection.

getProcessorback to summary
public Processor<E extends Context> getProcessor()

Get the default Processor to process IOEvent, occurring on connection phase.

Returns:Processor<E extends Context>

the default Processor to process IOEvent, occurring on connection phase.

getProcessorSelectorback to summary
public ProcessorSelector getProcessorSelector()

Gets the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.

Returns:ProcessorSelector

the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.

makeCancellableFutureback to summary
protected FutureImpl<Connection<L>> makeCancellableFuture(final Connection<L> connection)
preConfigureback to summary
protected void preConfigure(Connection<L> connection)

Pre-configures Connection object before actual connecting phase will be started.

Parameters
connection:Connection<L>

Connection to pre-configure.

removeMonitoringProbeback to summary
public boolean removeMonitoringProbe(ConnectionProbe probe)

Remove the ConnectionProbe.

Parameters
probe:ConnectionProbe

the ConnectionProbe.

Returns:boolean

true if probe was in the list and is now removed

setProcessorback to summary
public void setProcessor(Processor<E extends Context> processor)

Set the default Processor to process IOEvent, occurring on connection phase.

Parameters
processor:Processor<E extends Context>

the default Processor to process IOEvent, occurring on connection phase.

setProcessorSelectorback to summary
public void setProcessorSelector(ProcessorSelector processorSelector)

Sets the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.

Parameters
processorSelector:ProcessorSelector

the default ProcessorSelector, which will be used to get Processor to process I/O events, occurring on connection phase.

org.glassfish.grizzly back to summary

public abstract Class AbstractSocketConnectorHandler.Builder<E extends AbstractSocketConnectorHandler.Builder>

extends Object
Class Inheritance
Known Direct Subclasses
org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler.Builder, org.glassfish.grizzly.nio.transport.UDPNIOConnectorHandler.Builder
Annotations
@SuppressWarnings:unchecked
Type Parameters
<E>
itself

Builder

Field Summary

Modifier and TypeField and Description
protected ConnectionProbe
protected Processor<E extends Context>
protected ProcessorSelector

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public AbstractSocketConnectorHandler
protected abstract AbstractSocketConnectorHandler
public E
probe(ConnectionProbe connectionProbe)

public E
processor(final Processor<E extends Context> processor)

public E
processorSelector(final ProcessorSelector processorSelector)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

connectionProbeback to summary
protected ConnectionProbe connectionProbe
processorback to summary
protected Processor<E extends Context> processor
processorSelectorback to summary
protected ProcessorSelector processorSelector

Constructor Detail

Builderback to summary
public Builder()

Method Detail

buildback to summary
public AbstractSocketConnectorHandler build()
createback to summary
protected abstract AbstractSocketConnectorHandler create()
probeback to summary
public E probe(ConnectionProbe connectionProbe)
processorback to summary
public E processor(final Processor<E extends Context> processor)
processorSelectorback to summary
public E processorSelector(final ProcessorSelector processorSelector)