Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2002 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.advisor
Class AdvisletRegistry

    java.lang.Object
      |
      +--com.bea.p13n.advisor.AdvisletRegistry

public abstract class AdvisletRegistry
extends java.lang.Object
implements AdvisletRegistryConstants

The AdvisletRegistry allows an `Advislet` to be associated with a given URI prefix. This is achieved by use of the `advisor-registry.xml` file which specifies what advislets should be registered and against which URI prefixes.

Constructor Summary
`AdvisletRegistry()`

Method Summary
`static AdvisletChainElement` | `get(java.lang.String key)` Retrieves the `AdvisletChainElement` associated with a given key.
`static AdviceTransform` | `getAdviceTransform(java.lang.String key)` Retrieves the `AdviceTransform` associated with a key.
`static Advislet` | `getAdvislet(java.lang.String uriPrefix)` Retrieves the `Advislet` associated with a URI prefix.
`static java.lang.String` | `getUriPrefix(java.lang.String uri)` Trims a URI of the form: protocol://arguments and returns the protocol component.
`static void` | `initialize()` Initializes the registry by reading the default xml configuration file, loading the advislets defined and registering them against the URI prefixes supplied.
`static void` | `initialize(java.io.InputStream inputStream)` Initializes the registry by the xml configuration from an InputStream, loading the advislets defined and registering them against the URI prefixes supplied.
`static void` | `register(java.lang.String key, AdvisletChainElement advisletElement)` Registers an `AdvisletChainElement` and associates it with a key, which in the case of an Advislet is expected to be the URI prefix which will be used to refer to it.
`static void` | `unregister(java.lang.String key, AdvisletChainElement advisletElement)` Unregisters an `AdvisletChainElement` and disassociates from with a key.

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

Constructor Detail

### AdvisletRegistry

    public AdvisletRegistry()

Method Detail

### register

    public static void register(java.lang.String key,
                                AdvisletChainElement advisletElement)

  Registers an `AdvisletChainElement` and associates it with a key, which in the case of an Advislet is expected to be the URI prefix which will be used to refer to it.

  Parameters:
    `key` - The key to associate with the given element.
    `advisletElement` - The element to register.

### unregister

    public static void unregister(java.lang.String key,
                                  AdvisletChainElement advisletElement)

  Unregisters an `AdvisletChainElement` and disassociates from with a key.

  Parameters:
    `key` - The key of the associated element.
    `advisletElement` - The element to unregister.

### get

    public static AdvisletChainElement get(java.lang.String key)
                                    throws ElementNotFoundException

  Retrieves the `AdvisletChainElement` associated with a given key.

  Parameters:
    `key` - The key to use to lookup the AdvisletChainElement.
  Returns:
    The advislet registered against the key supplied.
  Throws:
    AdvisletNotFoundException - thrown when no element is registered against the supplied key

### getAdvislet

    public static Advislet getAdvislet(java.lang.String uriPrefix)
                                throws ElementNotFoundException

  Retrieves the `Advislet` associated with a URI prefix.

  Parameters:
    `uriPrefix` - The prefix to use to lookup the Advislet.
  Returns:
    The advislet registered against the prefix supplied.
  Throws:
    AdvisletNotFoundException - thrown when no advislet is registered against the supplied prefix

### getAdviceTransform

    public static AdviceTransform getAdviceTransform(java.lang.String key)
                                              throws ElementNotFoundException

  Retrieves the `AdviceTransform` associated with a key.

  Parameters:
    `key` - The key to use to lookup the AdviceTransform.
  Returns:
    The advisletTransform registered against the key supplied.
  Throws:
    AdvisletNotFoundException - thrown when no AdvisletTransform is registered against the supplied prefix

### getUriPrefix

    public static java.lang.String getUriPrefix(java.lang.String uri)

  Trims a URI of the form: protocol://arguments and returns the protocol component.

  Parameters:
    `uri` - The URI to be trimmed.
  Returns:
    The URI prefix of the supplied URI.
  Throws:
    java.lang.IllegalArgumentException - thrown when URI parsing fails

### initialize

    public static void initialize(java.io.InputStream inputStream)

  Initializes the registry by the xml configuration from an InputStream, loading the advislets defined and registering them against the URI prefixes supplied. Any existing advislets are not unregistered, and new registrations are appended.

### initialize

    public static void initialize()

  Initializes the registry by reading the default xml configuration file, loading the advislets defined and registering them against the URI prefixes supplied.

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2002 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 BEA Systems, Inc. All Rights Reserved