Home » apache-openwebbeans-1.0.0-incubating-M3-sources » org.apache.webbeans.spi » [javadoc | source]

    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements. See the NOTICE file distributed with this
    4    * work for additional information regarding copyright ownership. The ASF
    5    * licenses this file to You under the Apache License, Version 2.0 (the
    6    * "License"); you may not use this file except in compliance with the License.
    7    * You may obtain a copy of the License at
    8    * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
    9    * or agreed to in writing, software distributed under the License is
   10    * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   11    * KIND, either express or implied. See the License for the specific language
   12    * governing permissions and limitations under the License.
   13    */
   14   package org.apache.webbeans.spi;
   15   
   16   import org.apache.webbeans.exception.WebBeansException;
   17   
   18   /**
   19    * SPI for setting and retrieving objects from the JNDI.
   20    * Use this interface for all objects which should be stored and retreived
   21    * from the JNDI at runtime.
   22    *
   23    * This may be implemented via a static map for 
   24    * environments where no JNDI is available.
   25    */
   26   public interface JNDIService
   27   {
   28       /**JMS Connection Factory JNDI Name*/
   29       public static final String JMS_CONNECTION_FACTORY_JNDI_KEY = "org.apache.webbeans.spi.JNDIService.jmsConnectionFactoryJndi";
   30       
   31       /**Default value*/
   32       public static final String JMS_CONNECTION_FACTORY_JNDI_DEFAULT_VALUE = "ConnectionFactory";
   33   
   34       /**
   35        * Bind the object with the given name to the JNDI environment
   36        *  
   37        * @param name
   38        * @param object
   39        * @throws WebBeansException on any internal error
   40        */
   41       public abstract void bind(String name, Object object) throws WebBeansException;
   42   
   43       /**
   44        * Unbind and free the object with the given name from the JNDI environment
   45        * @param name
   46        * @throws WebBeansException on any internal error
   47        */
   48       public abstract void unbind(String name) throws WebBeansException;
   49   
   50       /**
   51        * Get the object bound to the given name from the JNDI context.   
   52        * @param name
   53        * @param expectedClass
   54        * @return the bound object or <code>null</code> if nothing bound.
   55        * @throws WebBeansException on any internal error
   56        */
   57       public abstract <T> T getObject(String name, Class<? extends T> expectedClass) throws WebBeansException;
   58   
   59   }

Home » apache-openwebbeans-1.0.0-incubating-M3-sources » org.apache.webbeans.spi » [javadoc | source]