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.archive.util
Class JndiUtils

    java.lang.Object
      org.archive.util.JndiUtils

    public class JndiUtils

extends java.lang.Object

JNDI utilities.

Version:
  $Date: 2005-10-27 22:20:20 +0000 (Thu, 27 Oct 2005) $ $Version$
Author:
  stack

Constructor Summary
`JndiUtils()`

Method Summary
`static javax.naming.CompoundName` | `bindObjectName(javax.naming.Context context, javax.management.ObjectName on)`
`static javax.naming.CompoundName` | `getCompoundName(javax.management.ObjectName on)` Return name to use as jndi name.
`static javax.naming.CompoundName` | `getCompoundName(java.lang.String name)`
`static javax.naming.Reference` | `getReference(javax.management.ObjectName on)`
`static javax.naming.Context` | `getSubContext(javax.naming.CompoundName subContext)` Get subcontext.
`static javax.naming.Context` | `getSubContext(java.lang.String subContext)` Get subcontext.
`static void` | `main(java.lang.String[] args)` Testing code.
`static javax.naming.CompoundName` | `unbindObjectName(javax.naming.Context context, javax.management.ObjectName on)`

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

Constructor Detail

### JndiUtils

    public JndiUtils()

Method Detail

### getCompoundName

    public static javax.naming.CompoundName getCompoundName(java.lang.String name)
                                                     throws javax.naming.InvalidNameException

  Throws:
    `javax.naming.InvalidNameException`

### getCompoundName

    public static javax.naming.CompoundName getCompoundName(javax.management.ObjectName on)
                                                     throws java.lang.NullPointerException,
                                                            javax.naming.InvalidNameException

  Return name to use as jndi name. Used to do a subset of the ObjectName fields but not just let all through so its easy to just use the jndi name to find mbean.

  Parameters:
    `on` - ObjectName instance to work with.
  Returns:
    Returns a compound name to use as jndi key.
  Throws:
    `java.lang.NullPointerException`
    `javax.naming.InvalidNameException`

### getReference

    public static javax.naming.Reference getReference(javax.management.ObjectName on)

  Parameters:
    `on` - ObjectName instance to work with.
  Returns:
    A simple reference based on passed `on`

### getSubContext

    public static javax.naming.Context getSubContext(java.lang.String subContext)
                                              throws javax.naming.NamingException

  Get subcontext. Only looks down one level.

  Parameters:
    `subContext` - Name of subcontext to return.
  Returns:
    Sub context.
  Throws:
    `javax.naming.NamingException`

### getSubContext

    public static javax.naming.Context getSubContext(javax.naming.CompoundName subContext)
                                              throws javax.naming.NamingException

  Get subcontext. Only looks down one level.

  Parameters:
    `subContext` - Name of subcontext to return.
  Returns:
    Sub context.
  Throws:
    `javax.naming.NamingException`

### bindObjectName

    public static javax.naming.CompoundName bindObjectName(javax.naming.Context context,
                                                           javax.management.ObjectName on)
                                                    throws javax.naming.NamingException,
                                                           java.lang.NullPointerException

  Parameters:
    `context` - A subcontext named for the `on.getDomain()` (Assumption is that caller already setup this subcontext).
    `on` - The ObjectName we're to base our bind name on.
  Returns:
    Returns key we used binding this ObjectName.
  Throws:
    `javax.naming.NamingException`
    `java.lang.NullPointerException`

### unbindObjectName

    public static javax.naming.CompoundName unbindObjectName(javax.naming.Context context,
                                                             javax.management.ObjectName on)
                                                      throws java.lang.NullPointerException,
                                                             javax.naming.NamingException

  Throws:
    `java.lang.NullPointerException`
    `javax.naming.NamingException`

### main

    public static void main(java.lang.String[] args)
                     throws javax.management.MalformedObjectNameException,
                            java.lang.NullPointerException,
                            javax.naming.InvalidNameException,
                            javax.naming.NamingException

  Testing code.

  Parameters:
    `args` - Command line arguments.
  Throws:
    `java.lang.NullPointerException`
    `javax.management.MalformedObjectNameException`
    `javax.naming.NamingException`
    `javax.naming.InvalidNameException`

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 © 2003-2008 Internet Archive. All Rights Reserved.