[webbeans-commits] Webbeans SVN: r1052 - in ri/trunk: webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap and 5 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Sat Jan 17 18:57:34 EST 2009
Author: pete.muir at jboss.org
Date: 2009-01-17 18:57:33 -0500 (Sat, 17 Jan 2009)
New Revision: 1052
Added:
ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ForwardingNamingContext.java
ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/NamingContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/AbstractNamingContext.java
Removed:
ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ForwardingNaming.java
ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/Naming.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/AbstractNaming.java
Modified:
ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbResolver.java
ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/ejb/spi/ForwardingEjbResolver.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/DefaultNaming.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletBootstrap.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java
Log:
rename naming->namingcontext
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-01-17 23:53:16 UTC (rev 1051)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-01-17 23:57:33 UTC (rev 1052)
@@ -60,7 +60,7 @@
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
-import org.jboss.webbeans.resources.spi.Naming;
+import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.util.BeanValidation;
import org.jboss.webbeans.util.Proxies;
@@ -116,17 +116,17 @@
private transient final ResourceLoader resourceLoader;
// The Naming (JNDI) access
- private transient final Naming naming;
+ private transient final NamingContext namingContext;
/**
* Create a new manager
*
* @param ejbResolver the ejbResolver to use
*/
- public ManagerImpl(Naming naming, EjbResolver ejbResolver, ResourceLoader resourceLoader)
+ public ManagerImpl(NamingContext namingContext, EjbResolver ejbResolver, ResourceLoader resourceLoader)
{
this.ejbResolver = ejbResolver;
- this.naming = naming;
+ this.namingContext = namingContext;
this.resourceLoader = resourceLoader;
this.beans = new CopyOnWriteArrayList<Bean<?>>();
this.beanMap = new ConcurrentHashMap<Class<?>, Bean<?>>();
@@ -732,9 +732,9 @@
return this;
}
- public Naming getNaming()
+ public NamingContext getNaming()
{
- return naming;
+ return namingContext;
}
public EjbResolver getEjbResolver()
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-01-17 23:53:16 UTC (rev 1051)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-01-17 23:57:33 UTC (rev 1052)
@@ -63,7 +63,7 @@
import org.jboss.webbeans.jsf.JSFApiAbstraction;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.resources.spi.Naming;
+import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.servlet.ServletApiAbstraction;
import org.jboss.webbeans.transaction.Transaction;
@@ -118,9 +118,9 @@
// The Web Beans manager
private ManagerImpl manager;
- protected void initManager(Naming naming, EjbResolver ejbResolver, ResourceLoader resourceLoader)
+ protected void initManager(NamingContext namingContext, EjbResolver ejbResolver, ResourceLoader resourceLoader)
{
- this.manager = new ManagerImpl(naming, ejbResolver, resourceLoader);
+ this.manager = new ManagerImpl(namingContext, ejbResolver, resourceLoader);
manager.getNaming().bind(ManagerImpl.JNDI_KEY, getManager());
CurrentManager.setRootManager(manager);
}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/AbstractNaming.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/AbstractNaming.java 2009-01-17 23:53:16 UTC (rev 1051)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/AbstractNaming.java 2009-01-17 23:57:33 UTC (rev 1052)
@@ -1,79 +0,0 @@
-package org.jboss.webbeans.resource;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.webbeans.ExecutionException;
-
-import org.jboss.webbeans.resources.spi.Naming;
-
-public abstract class AbstractNaming implements Naming
-{
-
- public abstract Context getContext();
-
- /**
- * Binds in item to JNDI
- *
- * @param key The key to bind under
- * @param value The value to bind
- */
- public void bind(String key, Object value)
- {
- try
- {
- List<String> parts = splitIntoContexts(key);
- Context context = getContext();
- for (int i = 0; i < parts.size() - 1; i++)
- {
- context = (Context) context.lookup(parts.get(i));
- }
- context.bind(parts.get(parts.size() - 1), value);
- }
- catch (NamingException e)
- {
- throw new ExecutionException("Cannot bind " + value + " to " + key, e);
- }
- }
-
- /**
- * Lookup an item from JNDI
- *
- * @param name The key
- * @param expectedType The expected return type
- * @return The found item
- */
- public <T> T lookup(String name, Class<? extends T> expectedType)
- {
- Object instance;
- try
- {
- instance = getContext().lookup(name);
- }
- catch (NamingException e)
- {
- throw new ExecutionException("Cannot lookup " + name, e);
- }
- try
- {
- return expectedType.cast(instance);
- }
- catch (ClassCastException e)
- {
- throw new ExecutionException(instance + " not of expected type " + expectedType, e);
- }
- }
-
- private static List<String> splitIntoContexts(String key)
- {
- List<String> parts = new ArrayList<String>();
- for (String part : key.split("/"))
- {
- parts.add(part);
- }
- return parts;
- }
-
-}
\ No newline at end of file
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/AbstractNamingContext.java (from rev 1049, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/AbstractNaming.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/AbstractNamingContext.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/AbstractNamingContext.java 2009-01-17 23:57:33 UTC (rev 1052)
@@ -0,0 +1,79 @@
+package org.jboss.webbeans.resource;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.webbeans.ExecutionException;
+
+import org.jboss.webbeans.resources.spi.NamingContext;
+
+public abstract class AbstractNamingContext implements NamingContext
+{
+
+ public abstract Context getContext();
+
+ /**
+ * Binds in item to JNDI
+ *
+ * @param key The key to bind under
+ * @param value The value to bind
+ */
+ public void bind(String key, Object value)
+ {
+ try
+ {
+ List<String> parts = splitIntoContexts(key);
+ Context context = getContext();
+ for (int i = 0; i < parts.size() - 1; i++)
+ {
+ context = (Context) context.lookup(parts.get(i));
+ }
+ context.bind(parts.get(parts.size() - 1), value);
+ }
+ catch (NamingException e)
+ {
+ throw new ExecutionException("Cannot bind " + value + " to " + key, e);
+ }
+ }
+
+ /**
+ * Lookup an item from JNDI
+ *
+ * @param name The key
+ * @param expectedType The expected return type
+ * @return The found item
+ */
+ public <T> T lookup(String name, Class<? extends T> expectedType)
+ {
+ Object instance;
+ try
+ {
+ instance = getContext().lookup(name);
+ }
+ catch (NamingException e)
+ {
+ throw new ExecutionException("Cannot lookup " + name, e);
+ }
+ try
+ {
+ return expectedType.cast(instance);
+ }
+ catch (ClassCastException e)
+ {
+ throw new ExecutionException(instance + " not of expected type " + expectedType, e);
+ }
+ }
+
+ private static List<String> splitIntoContexts(String key)
+ {
+ List<String> parts = new ArrayList<String>();
+ for (String part : key.split("/"))
+ {
+ parts.add(part);
+ }
+ return parts;
+ }
+
+}
\ No newline at end of file
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/AbstractNamingContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/DefaultNaming.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/DefaultNaming.java 2009-01-17 23:53:16 UTC (rev 1051)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/DefaultNaming.java 2009-01-17 23:57:33 UTC (rev 1052)
@@ -26,7 +26,7 @@
*
* @author Pete Muir
*/
-public class DefaultNaming extends AbstractNaming
+public class DefaultNaming extends AbstractNamingContext
{
private static final long serialVersionUID = 1L;
// The initial lookup context
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletBootstrap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletBootstrap.java 2009-01-17 23:53:16 UTC (rev 1051)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletBootstrap.java 2009-01-17 23:57:33 UTC (rev 1052)
@@ -31,7 +31,7 @@
import org.jboss.webbeans.context.SessionContext;
import org.jboss.webbeans.ejb.spi.EjbResolver;
import org.jboss.webbeans.resource.DefaultNaming;
-import org.jboss.webbeans.resources.spi.Naming;
+import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.util.DeploymentProperties;
@@ -81,9 +81,9 @@
initManager(createNaming(servletContext), createEjbResolver(servletContext), getResourceLoader());
}
- protected Naming createNaming(ServletContext servletContext)
+ protected NamingContext createNaming(ServletContext servletContext)
{
- Constructor<? extends Naming> namingConstructor = getClassConstructor(getDeploymentProperties(), getResourceLoader(), Naming.PROPERTY_NAME, Naming.class, ServletContext.class);
+ Constructor<? extends NamingContext> namingConstructor = getClassConstructor(getDeploymentProperties(), getResourceLoader(), NamingContext.PROPERTY_NAME, NamingContext.class, ServletContext.class);
if (namingConstructor != null)
{
return newInstance(namingConstructor, servletContext);
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java 2009-01-17 23:53:16 UTC (rev 1051)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java 2009-01-17 23:57:33 UTC (rev 1052)
@@ -19,8 +19,8 @@
import org.jboss.webbeans.bootstrap.spi.EjbDiscovery;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.ejb.spi.EjbResolver;
-import org.jboss.webbeans.resource.AbstractNaming;
-import org.jboss.webbeans.resources.spi.Naming;
+import org.jboss.webbeans.resource.AbstractNamingContext;
+import org.jboss.webbeans.resources.spi.NamingContext;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.test.mock.context.MockApplicationContext;
import org.jboss.webbeans.test.mock.context.MockDependentContext;
@@ -30,7 +30,7 @@
public class MockBootstrap extends WebBeansBootstrap
{
- public static class MockNaming extends AbstractNaming
+ public static class MockNaming extends AbstractNamingContext
{
private Context context;
@@ -133,13 +133,13 @@
return PersistenceContext.class;
}
- public Object resolveEjb(InjectionPoint injectionPoint, Naming naming)
+ public Object resolveEjb(InjectionPoint injectionPoint, NamingContext namingContext)
{
// TODO Implement EJB resolution for Unit tests
return null;
}
- public Object resolvePersistenceContext(InjectionPoint injectionPoint, Naming naming)
+ public Object resolvePersistenceContext(InjectionPoint injectionPoint, NamingContext namingContext)
{
// TODO Implement PU resolution for Unit tests
return null;
@@ -150,7 +150,7 @@
return Resource.class;
}
- public Object resolveResource(InjectionPoint injectionPoint, Naming naming)
+ public Object resolveResource(InjectionPoint injectionPoint, NamingContext namingContext)
{
// TODO Auto-generated method stub
return null;
Modified: ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbResolver.java
===================================================================
--- ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbResolver.java 2009-01-17 23:53:16 UTC (rev 1051)
+++ ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbResolver.java 2009-01-17 23:57:33 UTC (rev 1052)
@@ -4,7 +4,7 @@
import javax.webbeans.InjectionPoint;
-import org.jboss.webbeans.resources.spi.Naming;
+import org.jboss.webbeans.resources.spi.NamingContext;
/**
* A container should implement this interface to allow the Web Beans RI to
@@ -30,13 +30,13 @@
* @throws IllegalStateException
* if no EJBs can be resolved for injection
*/
- public Object resolveEjb(InjectionPoint injectionPoint, Naming naming);
+ public Object resolveEjb(InjectionPoint injectionPoint, NamingContext namingContext);
/**
* Resolve the value for the given @PersistenceContext injection point
*
* @param injectionPoint the injection point metadata
- * @param naming the pluggable Web Beans JNDI lookup facility
+ * @param namingContext the pluggable Web Beans JNDI lookup facility
* @return an instance of the persistence unit
* @throws IllegalArgumentException
* if the injection point is not annotated with
@@ -45,13 +45,13 @@
* @throws IllegalStateException
* if no suitable persistence units can be resolved for injection
*/
- public Object resolvePersistenceContext(InjectionPoint injectionPoint, Naming naming);
+ public Object resolvePersistenceContext(InjectionPoint injectionPoint, NamingContext namingContext);
/**
* Resolve the value for the given @Resource injection point
*
* @param injectionPoint the injection point metadata
- * @param naming the pluggable Web Beans JNDI lookup facility
+ * @param namingContext the pluggable Web Beans JNDI lookup facility
* @return an instance of the resource
* @throws IllegalArgumentException
* if the injection point is not annotated with @Resource, or, if
@@ -60,7 +60,7 @@
* @throws IllegalStateException
* if no resource can be resolved for injection
*/
- public Object resolveResource(InjectionPoint injectionPoint, Naming naming);
+ public Object resolveResource(InjectionPoint injectionPoint, NamingContext namingContext);
/**
* Get the annotation which defines an @EJB injection point
Modified: ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/ejb/spi/ForwardingEjbResolver.java
===================================================================
--- ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/ejb/spi/ForwardingEjbResolver.java 2009-01-17 23:53:16 UTC (rev 1051)
+++ ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/ejb/spi/ForwardingEjbResolver.java 2009-01-17 23:57:33 UTC (rev 1052)
@@ -4,7 +4,7 @@
import javax.webbeans.InjectionPoint;
-import org.jboss.webbeans.resources.spi.Naming;
+import org.jboss.webbeans.resources.spi.NamingContext;
/**
* An implementation of {@link EjbResolver} which forwards all its method calls
@@ -36,19 +36,19 @@
return delegate().getResourceAnnotation();
}
- public Object resolveEjb(InjectionPoint injectionPoint, Naming naming)
+ public Object resolveEjb(InjectionPoint injectionPoint, NamingContext namingContext)
{
- return delegate().resolveEjb(injectionPoint, naming);
+ return delegate().resolveEjb(injectionPoint, namingContext);
}
- public Object resolvePersistenceContext(InjectionPoint injectionPoint, Naming naming)
+ public Object resolvePersistenceContext(InjectionPoint injectionPoint, NamingContext namingContext)
{
- return delegate().resolvePersistenceContext(injectionPoint, naming);
+ return delegate().resolvePersistenceContext(injectionPoint, namingContext);
}
- public Object resolveResource(InjectionPoint injectionPoint, Naming naming)
+ public Object resolveResource(InjectionPoint injectionPoint, NamingContext namingContext)
{
- return delegate().resolveResource(injectionPoint, naming);
+ return delegate().resolveResource(injectionPoint, namingContext);
}
@Override
Deleted: ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ForwardingNaming.java
===================================================================
--- ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ForwardingNaming.java 2009-01-17 23:53:16 UTC (rev 1051)
+++ ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ForwardingNaming.java 2009-01-17 23:57:33 UTC (rev 1052)
@@ -1,47 +0,0 @@
-package org.jboss.webbeans.resources.spi;
-
-
-/**
- * An implementation of {@link Naming} which forwards all its method calls
- * to another {@link Naming}}. Subclasses should override one or more
- * methods to modify the behavior of the backing {@link Naming} as desired
- * per the <a
- * href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>.
- *
- * @author Pete Muir
- *
- */
-public abstract class ForwardingNaming implements Naming
-{
-
- protected abstract Naming delegate();
-
- public void bind(String key, Object value)
- {
- delegate().bind(key, value);
- }
-
- public <T> T lookup(String name, Class<? extends T> expectedType)
- {
- return delegate().lookup(name, expectedType);
- }
-
- @Override
- public boolean equals(Object obj)
- {
- return delegate().equals(obj);
- }
-
- @Override
- public String toString()
- {
- return delegate().toString();
- }
-
- @Override
- public int hashCode()
- {
- return delegate().hashCode();
- }
-
-}
Copied: ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ForwardingNamingContext.java (from rev 1051, ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ForwardingNaming.java)
===================================================================
--- ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ForwardingNamingContext.java (rev 0)
+++ ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ForwardingNamingContext.java 2009-01-17 23:57:33 UTC (rev 1052)
@@ -0,0 +1,47 @@
+package org.jboss.webbeans.resources.spi;
+
+
+/**
+ * An implementation of {@link NamingContext} which forwards all its method calls
+ * to another {@link NamingContext}}. Subclasses should override one or more
+ * methods to modify the behavior of the backing {@link NamingContext} as desired
+ * per the <a
+ * href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>.
+ *
+ * @author Pete Muir
+ *
+ */
+public abstract class ForwardingNamingContext implements NamingContext
+{
+
+ protected abstract NamingContext delegate();
+
+ public void bind(String key, Object value)
+ {
+ delegate().bind(key, value);
+ }
+
+ public <T> T lookup(String name, Class<? extends T> expectedType)
+ {
+ return delegate().lookup(name, expectedType);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ForwardingNamingContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/Naming.java
===================================================================
--- ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/Naming.java 2009-01-17 23:53:16 UTC (rev 1051)
+++ ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/Naming.java 2009-01-17 23:57:33 UTC (rev 1052)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.webbeans.resources.spi;
-
-public interface Naming
-{
-
- public static final String PROPERTY_NAME = Naming.class.getName();
-
- /**
- * Typed JNDI lookup
- *
- * @param <T> The type
- * @param name The JNDI name
- * @param expectedType The expected type
- * @return The object
- */
- public <T> T lookup(String name, Class<? extends T> expectedType);
-
- /**
- * Binds an item to JNDI
- *
- * @param key The key to bind under
- * @param value The item to bind
- */
- public void bind(String key, Object value);
-
-}
Copied: ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/NamingContext.java (from rev 1049, ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/Naming.java)
===================================================================
--- ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/NamingContext.java (rev 0)
+++ ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/NamingContext.java 2009-01-17 23:57:33 UTC (rev 1052)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.webbeans.resources.spi;
+
+public interface NamingContext
+{
+
+ public static final String PROPERTY_NAME = NamingContext.class.getName();
+
+ /**
+ * Typed JNDI lookup
+ *
+ * @param <T> The type
+ * @param name The JNDI name
+ * @param expectedType The expected type
+ * @return The object
+ */
+ public <T> T lookup(String name, Class<? extends T> expectedType);
+
+ /**
+ * Binds an item to JNDI
+ *
+ * @param key The key to bind under
+ * @param value The item to bind
+ */
+ public void bind(String name, Object value);
+
+}
Property changes on: ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/NamingContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
More information about the weld-commits
mailing list