DefaultServiceSelector (Avalon Framework 4.1.5 API)
Keywords: org.apache.avalon.framework.service.DefaultServiceSelector class

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.avalon.framework.service
Class DefaultServiceSelector

    java.lang.Object
      org.apache.avalon.framework.service.DefaultServiceSelector

All Implemented Interfaces:
  ServiceSelector

public class DefaultServiceSelector
extends Object
implements ServiceSelector

This is the default implementation of the ServiceSelector

Version:
  CVS $Revision: 1.14 $ $Date: 2003/02/25 15:35:43 $
Author:
  Avalon Development Team

Constructor Summary
`DefaultServiceSelector()` Create a DefaultServiceSelector with a default empty role.
`DefaultServiceSelector(String role)` Create a DefaultServiceSelector with a role for debug purposes.

Method Summary
`protected void` | `checkWriteable()` Checks if this service selector is writeable.
`protected Map` | `getObjectMap()` Helper method for subclasses to retrieve object map.
`boolean` | `isSelectable(Object hint)` Returns whether a Object exists or not
`void` | `makeReadOnly()` Makes this service selector read-only.
`void` | `put(Object hint, Object object)` Populate the ServiceSelector.
`void` | `release(Object object)` Release object.
`Object` | `select(Object hint)` Select the desired object.

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

Constructor Detail

### DefaultServiceSelector

    public DefaultServiceSelector()

  Create a DefaultServiceSelector with a default empty role.

### DefaultServiceSelector

    public DefaultServiceSelector(String role)

  Create a DefaultServiceSelector with a role for debug purposes.

Parameters:
  `role` - The role for this selector.
Throws:
  `NullPointerException` - if the role is null.

Method Detail

### select

    public Object select(Object hint)
                  throws ServiceException

  Select the desired object.

  Specified by:
    `select` in interface `ServiceSelector`
  Parameters:
    `hint` - the hint to retrieve Object
  Returns:
    the Object
  Throws:
    `ServiceException` - if an error occurs

### isSelectable

    public boolean isSelectable(Object hint)

  Returns whether a Object exists or not

  Specified by:
    `isSelectable` in interface `ServiceSelector`
  Parameters:
    `hint` - the hint to retrieve Object
  Returns:
    `true` if the Object exists

### release

    public void release(Object object)

  Release object.

  Specified by:
    `release` in interface `ServiceSelector`
  Parameters:
    `object` - the `Object` to release

### put

    public void put(Object hint,
                    Object object)

  Populate the ServiceSelector.

  Parameters:
    `hint` - the hint to be used to retrieve the Object later
    `object` - the Object to hold

### getObjectMap

    protected final Map getObjectMap()

  Helper method for subclasses to retrieve object map.

  Returns:
    the object map

### makeReadOnly

    public void makeReadOnly()

  Makes this service selector read-only.

### checkWriteable

    protected final void checkWriteable()
                                 throws IllegalStateException

  Checks if this service selector is writeable.

  Throws:
    `IllegalStateException` - if this service selector is read-only

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 © Apache Software Foundation. All Rights Reserved.