Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


com.tangosol.net
Class WrapperSocketProvider

java.lang.Object
  extended by java.nio.channels.spi.SelectorProvider
      extended by com.tangosol.net.WrapperSocketProvider

All Implemented Interfaces:
SocketProvider, XmlConfigurable
Direct Known Subclasses:
TcpSocketProvider

public abstract class WrapperSocketProvider
extends java.nio.channels.spi.SelectorProvider
implements SocketProvider, XmlConfigurable

WrapperSocketProvider is a SocketProvider which produces wrapped sockets which are obtained from a delegate SocketProvider.

Since:
Coherence 3.6
Author:
mf 2010.05.19

Field Summary
protected  SocketProviderFactory m_factory
          The associated factory.
protected  XmlElement m_xml
          The configuration supplied to the provider.

 

Constructor Summary
protected WrapperSocketProvider()
          Construct a WrapperSocketProvider with no delegate, allowing the delegate to be specified programatically or through configuration.
  WrapperSocketProvider(SocketProvider provider)
          Construct a WrapperSocketProvider which delegates all SocketProvider calls to the delegate.

 

Method Summary
 SocketProvider ensureDelegate()
          Return the delegate SocketProvider, creating one if necessary.
 XmlElement getConfig()
          Determine the current configuration of the object.
 SocketProvider getDelegate()
          Return the delegate SocketProvider.
 SocketProviderFactory getFactory()
          Return the factory associated with this provider.
 java.nio.channels.Channel inheritedChannel()
          Unsupported.
 java.nio.channels.DatagramChannel openDatagramChannel()
          Return a new DatagramChannel.
 java.net.DatagramSocket openDatagramSocket()
          Return a new DatagramSocket.
 java.net.MulticastSocket openMulticastSocket()
          Return a new MulticastSocket.
 java.nio.channels.Pipe openPipe()
          Unsupported.
 java.nio.channels.spi.AbstractSelector openSelector()
          
 java.net.ServerSocket openServerSocket()
          Return a new ServerSocket.
 java.nio.channels.ServerSocketChannel openServerSocketChannel()
          Return a new ServerSocketChannel.
 java.net.Socket openSocket()
          Return a new Socket.
 java.nio.channels.SocketChannel openSocketChannel()
          Return a new SocketChannel.
 void setConfig(XmlElement xml)
          Specify the configuration for the object.
 void setDelegate(SocketProvider provider)
          Set the delegate SocketProvider
 void setFactory(SocketProviderFactory factory)
          Specify the SocketProviderFactory associated with this provider.

 

Methods inherited from class java.nio.channels.spi.SelectorProvider
provider

 

Field Detail

m_factory

protected SocketProviderFactory m_factory
The associated factory.

m_xml

protected XmlElement m_xml
The configuration supplied to the provider.

Constructor Detail

WrapperSocketProvider

public WrapperSocketProvider(SocketProvider provider)
Construct a WrapperSocketProvider which delegates all SocketProvider calls to the delegate.
Parameters:
provider - the delegate provider

WrapperSocketProvider

protected WrapperSocketProvider()
Construct a WrapperSocketProvider with no delegate, allowing the delegate to be specified programatically or through configuration.

Method Detail

setDelegate

public void setDelegate(SocketProvider provider)
Set the delegate SocketProvider
Parameters:
provider - the delegate provider
Throws:
java.lang.IllegalStateException - if a provider has already been configured

getDelegate

public SocketProvider getDelegate()
Return the delegate SocketProvider.
Returns:
the delegate SocketProvider

ensureDelegate

public SocketProvider ensureDelegate()
                              throws java.io.IOException
Return the delegate SocketProvider, creating one if necessary.
Returns:
the delegate SocketProvider
Throws:
java.io.IOException - if an I/O error occurs

openSocket

public java.net.Socket openSocket()
                           throws java.io.IOException
Return a new Socket.
Specified by:
openSocket in interface SocketProvider
Returns:
the Socket
Throws:
java.io.IOException - if an I/O related error occurs

openSocketChannel

public java.nio.channels.SocketChannel openSocketChannel()
                                                  throws java.io.IOException
Return a new SocketChannel.
Specified by:
openSocketChannel in interface SocketProvider
Specified by:
openSocketChannel in class java.nio.channels.spi.SelectorProvider
Returns:
the connected SocketChannel
Throws:
java.io.IOException - if an I/O related error occurs

openServerSocket

public java.net.ServerSocket openServerSocket()
                                       throws java.io.IOException
Return a new ServerSocket.
Specified by:
openServerSocket in interface SocketProvider
Returns:
the ServerSocket
Throws:
java.io.IOException - if an I/O related error occurs

openServerSocketChannel

public java.nio.channels.ServerSocketChannel openServerSocketChannel()
                                                              throws java.io.IOException
Return a new ServerSocketChannel.
Specified by:
openServerSocketChannel in interface SocketProvider
Specified by:
openServerSocketChannel in class java.nio.channels.spi.SelectorProvider
Returns:
the ServerSocketChannel
Throws:
java.io.IOException - if an I/O related error occurs

openDatagramSocket

public java.net.DatagramSocket openDatagramSocket()
                                           throws java.io.IOException
Return a new DatagramSocket.
Specified by:
openDatagramSocket in interface SocketProvider
Returns:
the DatagramSocket
Throws:
java.io.IOException - if an I/O related error occurs

openDatagramChannel

public java.nio.channels.DatagramChannel openDatagramChannel()
                                                      throws java.io.IOException
Return a new DatagramChannel.
Specified by:
openDatagramChannel in interface SocketProvider
Specified by:
openDatagramChannel in class java.nio.channels.spi.SelectorProvider
Returns:
the DatagramChannel
Throws:
java.io.IOException - if an I/O related error occurs

openMulticastSocket

public java.net.MulticastSocket openMulticastSocket()
                                             throws java.io.IOException
Return a new MulticastSocket.
Specified by:
openMulticastSocket in interface SocketProvider
Returns:
the MulticastSocket
Throws:
java.io.IOException - if an I/O related error occurs

setFactory

public void setFactory(SocketProviderFactory factory)
Specify the SocketProviderFactory associated with this provider.
Specified by:
setFactory in interface SocketProvider
Parameters:
factory - the associated factory

getFactory

public SocketProviderFactory getFactory()
Return the factory associated with this provider.
Specified by:
getFactory in interface SocketProvider
Returns:
the associated factory

openSelector

public java.nio.channels.spi.AbstractSelector openSelector()
                                                    throws java.io.IOException
Specified by:
openSelector in class java.nio.channels.spi.SelectorProvider
Throws:
java.io.IOException

openPipe

public java.nio.channels.Pipe openPipe()
                                throws java.io.IOException
Unsupported.
Specified by:
openPipe in class java.nio.channels.spi.SelectorProvider
Throws:
java.lang.UnsupportedOperationException
java.io.IOException

inheritedChannel

public java.nio.channels.Channel inheritedChannel()
                                           throws java.io.IOException
Unsupported.
Overrides:
inheritedChannel in class java.nio.channels.spi.SelectorProvider
Throws:
java.lang.UnsupportedOperationException
java.io.IOException

getConfig

public XmlElement getConfig()
Determine the current configuration of the object.
Specified by:
getConfig in interface XmlConfigurable
Returns:
the XML configuration or null

setConfig

public void setConfig(XmlElement xml)
Specify the configuration for the object.
Specified by:
setConfig in interface XmlConfigurable
Parameters:
xml - the XML configuration for the object

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.1.0

E22843-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.