Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.mina.integration.spring
Class Binding

    java.lang.Object
      org.apache.mina.integration.spring.Binding

All Implemented Interfaces:
  InitializingBean

    public class Binding

extends Object
implements InitializingBean

Defines an address to `IoHandler` binding. This is used when specifying the addresses to accept new connections on when creating `IoAcceptor` objects using `IoAcceptorFactoryBean`.

Note that the `address` property is of `SocketAddress` type. Use `InetSocketAddressEditor` or `VmPipeAddressEditor` in your Spring configuration file to simply the creation of `SocketAddress` instances using Spring.

This class also allows for an optional service configuration using `setServiceConfig(IoServiceConfig)` to be specified. If the binding specifies an `IoServiceConfig` `IoAcceptorFactoryBean` will use `IoAcceptor.bind(SocketAddress, IoHandler, IoServiceConfig)` instead of `IoAcceptor.bind(SocketAddress, IoHandler)` when binding. The `IoServiceConfig` object lets you specify transport specific confiuration options and define port specific filters. This makes it possible to specify different filters depending on the port the client is connecting on (e.g. using an `SSLFilter` when connecting on port 443 but not on port 80).

Version:
  $Rev: 555855 $, $Date: 2007-07-13 05:19:00 +0200 (Fri, 13 Jul 2007) $
Author:
  The Apache Directory Project (mina-dev@directory.apache.org)

Constructor Summary
`Binding()` Creates a new empty instance.
`Binding(SocketAddress address, IoHandler handler)` Creates a new instance using the specified values.
`Binding(SocketAddress address, IoHandler handler, IoServiceConfig serviceConfig)` Creates a new instance using the specified values.

Method Summary
`void` | `afterPropertiesSet()`
`SocketAddress` | `getAddress()` Returns the address the handler of this object will be bound to.
`IoHandler` | `getHandler()` Returns the handler of this binding object.
`IoServiceConfig` | `getServiceConfig()`
`void` | `setAddress(SocketAddress address)` Sets the address the handler of this object will be bound to.
`void` | `setHandler(IoHandler handler)` Sets the handler of this binding object.
`void` | `setServiceConfig(IoServiceConfig serviceConfig)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Binding

    public Binding()

  Creates a new empty instance.

### Binding

    public Binding(SocketAddress address,
                   IoHandler handler)

  Creates a new instance using the specified values.

  Parameters:
    `address` - the address.
    `handler` - the handler.
  Throws:
    `IllegalArgumentException` - if the any of the specified values are `null`.

### Binding

    public Binding(SocketAddress address,
                   IoHandler handler,
                   IoServiceConfig serviceConfig)

  Creates a new instance using the specified values.

  Parameters:
    `address` - the address.
    `handler` - the handler.
    `serviceConfig` - the service configuration.
  Throws:
    `IllegalArgumentException` - if the any of the specified values are `null`.

Method Detail

### getAddress

    public SocketAddress getAddress()

  Returns the address the handler of this object will be bound to.

  Returns:
    the address.

### setAddress

    public void setAddress(SocketAddress address)

  Sets the address the handler of this object will be bound to.

  Parameters:
    `address` - the address.
  Throws:
    `IllegalArgumentException` - if the specified value is `null`.

### getHandler

    public IoHandler getHandler()

  Returns the handler of this binding object.

  Returns:
    the handler.

### setHandler

    public void setHandler(IoHandler handler)

  Sets the handler of this binding object.

  Parameters:
    `handler` - the handler.
  Throws:
    `IllegalArgumentException` - if the specified value is `null`.

### getServiceConfig

    public IoServiceConfig getServiceConfig()

### setServiceConfig

    public void setServiceConfig(IoServiceConfig serviceConfig)

### afterPropertiesSet

    public void afterPropertiesSet()
                            throws Exception

  Specified by:
    `afterPropertiesSet` in interface `InitializingBean`
  Throws:
    `Exception`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2008 Apache MINA Project. All Rights Reserved.