[webbeans-commits] Webbeans SVN: r737 - in ri/trunk/webbeans-ri/src: main/java/org/jboss/webbeans/bean and 14 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-12-26 17:51:21 -0500 (Fri, 26 Dec 2008)
New Revision: 737
Added:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/binding/
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exception/
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/DefaultNaming.java
Removed:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/DefaultNaming.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InstanceBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/binding/CurrentBinding.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/binding/InitializedBinding.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/PropertiesBasedBootstrap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/SessionBeanInterceptor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/el/WebBeansELResolver.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exception/NotAScopeException.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletBootstrap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/examples/Tests.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionTests.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/DependentContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/NormalContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanLifecycleTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanRemoveMethodTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java
Log:
Part II
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 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -51,7 +51,7 @@
import org.jboss.webbeans.bean.AbstractBean;
import org.jboss.webbeans.bean.proxy.ProxyPool;
-import org.jboss.webbeans.contexts.ContextMap;
+import org.jboss.webbeans.context.ContextMap;
import org.jboss.webbeans.ejb.EjbDescriptorCache;
import org.jboss.webbeans.event.EventManager;
import org.jboss.webbeans.introspector.AnnotatedItem;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -38,7 +38,7 @@
import javax.webbeans.manager.Bean;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.bindings.CurrentBinding;
+import org.jboss.webbeans.binding.CurrentBinding;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.introspector.jlr.AbstractAnnotatedItem.AnnotationMap;
import org.jboss.webbeans.log.LogProvider;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -37,7 +37,7 @@
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bootstrap.spi.EjbDescriptor;
-import org.jboss.webbeans.contexts.DependentContext;
+import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.AnnotatedParameter;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -24,7 +24,7 @@
import javax.webbeans.Event;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.contexts.DependentContext;
+import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.event.EventImpl;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.introspector.AnnotatedParameter;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InstanceBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InstanceBean.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/InstanceBean.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -22,7 +22,7 @@
import org.jboss.webbeans.InstanceImpl;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.contexts.DependentContext;
+import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.introspector.AnnotatedItem;
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -20,7 +20,7 @@
import java.lang.reflect.Field;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.contexts.DependentContext;
+import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.jlr.AnnotatedFieldImpl;
import org.jboss.webbeans.util.Names;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -27,7 +27,7 @@
import javax.webbeans.Observes;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.contexts.DependentContext;
+import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.jlr.AnnotatedMethodImpl;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -28,7 +28,7 @@
import javax.webbeans.manager.Manager;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.contexts.DependentContext;
+import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.introspector.AnnotatedConstructor;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedMethod;
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/binding (from rev 734, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bindings)
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/binding
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/binding/CurrentBinding.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bindings/CurrentBinding.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/binding/CurrentBinding.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.jboss.webbeans.bindings;
+package org.jboss.webbeans.binding;
import javax.webbeans.AnnotationLiteral;
import javax.webbeans.Current;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/binding/InitializedBinding.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bindings/InitializedBinding.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/binding/InitializedBinding.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -1,4 +1,4 @@
-package org.jboss.webbeans.bindings;
+package org.jboss.webbeans.binding;
import javax.webbeans.AnnotationLiteral;
import javax.webbeans.manager.Initialized;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/PropertiesBasedBootstrap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/PropertiesBasedBootstrap.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/PropertiesBasedBootstrap.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -24,7 +24,7 @@
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.resources.DefaultNaming;
+import org.jboss.webbeans.resource.DefaultNaming;
import org.jboss.webbeans.resources.spi.Naming;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.servlet.ServletBootstrap;
@@ -73,7 +73,7 @@
* Creates an instance of the type
*
* @param constructor The constructor to use
- * @param parameters The parameters to pass to the contstructor
+ * @param parameters The parameters to pass to the constructor
* @return An instance of the type
*/
protected static <T> T newInstance(Constructor<T> constructor, Object... parameters)
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 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -50,7 +50,7 @@
import org.jboss.webbeans.bean.ProducerFieldBean;
import org.jboss.webbeans.bean.ProducerMethodBean;
import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.bindings.InitializedBinding;
+import org.jboss.webbeans.binding.InitializedBinding;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.ejb.EJBApiAbstraction;
import org.jboss.webbeans.event.ObserverImpl;
@@ -73,8 +73,7 @@
* @author Pete Muir
*/
public abstract class WebBeansBootstrap
-{
-
+{
// The log provider
private static LogProvider log = Logging.getLogProvider(WebBeansBootstrap.class);
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/SessionBeanInterceptor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/SessionBeanInterceptor.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/SessionBeanInterceptor.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -46,7 +46,12 @@
enterpriseBean.postConstruct(invocationContext.getTarget());
}
}
-
+
+ /**
+ * Gets the underlying target and calls the pre-destroy method
+ *
+ * @param invocationContext The invocation context
+ */
@PreDestroy
public void preDestroy(InvocationContext invocationContext)
{
@@ -56,7 +61,13 @@
enterpriseBean.preDestroy(invocationContext.getTarget());
}
}
-
+
+ /**
+ * Gets a bean based on the target in the invocation context
+ *
+ * @param invocationContext The invocation context
+ * @return The found bean or null if the bean was not an enterprise bean
+ */
@SuppressWarnings("unchecked")
private static EnterpriseBean<Object> getBean(InvocationContext invocationContext)
{
@@ -71,5 +82,5 @@
return null;
}
}
-
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/el/WebBeansELResolver.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/el/WebBeansELResolver.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/el/WebBeansELResolver.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -24,7 +24,7 @@
import javax.el.ELResolver;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.contexts.DependentContext;
+import org.jboss.webbeans.context.DependentContext;
public class WebBeansELResolver extends ELResolver
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -28,7 +28,7 @@
import javax.webbeans.Observer;
-import org.jboss.webbeans.contexts.DependentContext;
+import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.Strings;
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exception (from rev 734, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions)
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exception
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exception/NotAScopeException.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/NotAScopeException.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exception/NotAScopeException.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.jboss.webbeans.exceptions;
+package org.jboss.webbeans.exception;
import javax.webbeans.DefinitionException;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -32,7 +32,7 @@
import javax.webbeans.BindingType;
import javax.webbeans.manager.Manager;
-import org.jboss.webbeans.bindings.CurrentBinding;
+import org.jboss.webbeans.binding.CurrentBinding;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.util.Reflections;
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource (from rev 734, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resources)
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/DefaultNaming.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resources/DefaultNaming.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/DefaultNaming.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -1,66 +0,0 @@
-package org.jboss.webbeans.resources;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.webbeans.ExecutionException;
-
-import org.jboss.webbeans.resources.spi.Naming;
-
-public class DefaultNaming implements Naming
-{
-
- private transient InitialContext initialContext;
-
- public DefaultNaming()
- {
- try
- {
- this.initialContext = new InitialContext();
- }
- catch (NamingException e)
- {
- throw new ExecutionException("Could not obtain InitialContext", e);
- }
- }
-
-
-
- public InitialContext getInitialContext()
- {
- return initialContext;
- }
-
- public void bind(String key, Object value)
- {
- try
- {
- initialContext.bind(key, value);
- }
- catch (NamingException e)
- {
- throw new ExecutionException("Cannot bind " + value + " to " + key, e);
- }
- }
-
- public <T> T lookup(String name, Class<? extends T> expectedType)
- {
- Object instance;
- try
- {
- instance = initialContext.lookup(name);
- }
- catch (NamingException e)
- {
- throw new ExecutionException("Cannot lookup " + name, e);
- }
- try
- {
- return (T) instance;
- }
- catch (ClassCastException e)
- {
- throw new ExecutionException(instance + " not of expected type " + expectedType, e);
- }
- }
-
-}
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/DefaultNaming.java (from rev 735, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resources/DefaultNaming.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/DefaultNaming.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resource/DefaultNaming.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -0,0 +1,109 @@
+/*
+ * 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.resource;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.webbeans.ExecutionException;
+
+import org.jboss.webbeans.resources.spi.Naming;
+
+/**
+ * The default naming provider
+ *
+ * @author Pete Muir
+ */
+public class DefaultNaming implements Naming
+{
+ private static final long serialVersionUID = 1L;
+ // The initial lookup context
+ private transient InitialContext initialContext;
+
+ /**
+ * Constructor
+ */
+ public DefaultNaming()
+ {
+ try
+ {
+ this.initialContext = new InitialContext();
+ }
+ catch (NamingException e)
+ {
+ throw new ExecutionException("Could not obtain InitialContext", e);
+ }
+ }
+
+ /**
+ * Gets the initial context
+ *
+ * @return The initial context
+ */
+ public InitialContext getInitialContext()
+ {
+ return initialContext;
+ }
+
+ /**
+ * 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
+ {
+ initialContext.bind(key, 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
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T lookup(String name, Class<? extends T> expectedType)
+ {
+ Object instance;
+ try
+ {
+ instance = initialContext.lookup(name);
+ }
+ catch (NamingException e)
+ {
+ throw new ExecutionException("Cannot lookup " + name, e);
+ }
+ try
+ {
+ return (T) instance;
+ }
+ catch (ClassCastException e)
+ {
+ throw new ExecutionException(instance + " not of expected type " + expectedType, e);
+ }
+ }
+
+}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -1,96 +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.servlet;
-
-import java.util.Enumeration;
-
-import javax.servlet.ServletContext;
-
-import org.jboss.webbeans.contexts.AbstractBeanMap;
-import org.jboss.webbeans.contexts.ApplicationContext;
-
-/**
- * A BeanMap that uses a servlet context as backing map
- *
- * @author Nicklas Karlsson
- *
- * @see org.jboss.webbeans.contexts.ApplicationContext
- */
-public class ApplicationBeanMap extends AbstractBeanMap
-{
- // The servlet context to use as backing map
- private ServletContext context;
-
- /**
- * Constructor
- *
- * @param context The servlet context instance
- */
- public ApplicationBeanMap(ServletContext context)
- {
- super();
- this.context = context;
- }
-
- /**
- * @see org.jboss.webbeans.contexts.AbstractBeanMap#getKeyPrefix()
- */
- @Override
- protected String getKeyPrefix()
- {
- return ApplicationContext.class.getName();
- }
-
- /**
- * @see org.jboss.webbeans.contexts.AbstractBeanMap#getAttribute()
- */
- @Override
- protected Object getAttribute(String key)
- {
- return context.getAttribute(key);
- }
-
- /**
- * @see org.jboss.webbeans.contexts.AbstractBeanMap#getAttributeNames()
- */
- @SuppressWarnings("unchecked")
- @Override
- protected Enumeration<String> getAttributeNames()
- {
- return context.getAttributeNames();
- }
-
- /**
- * @see org.jboss.webbeans.contexts.AbstractBeanMap#removeAttributes()
- */
- @Override
- protected void removeAttribute(String key)
- {
- context.removeAttribute(key);
- }
-
- /**
- * @see org.jboss.webbeans.contexts.AbstractBeanMap#setAttribute()
- */
- @Override
- protected void setAttribute(String key, Object instance)
- {
- context.setAttribute(key, instance);
- }
-
-}
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 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletBootstrap.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -24,10 +24,11 @@
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bootstrap.PropertiesBasedBootstrap;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-import org.jboss.webbeans.contexts.ApplicationContext;
-import org.jboss.webbeans.contexts.DependentContext;
-import org.jboss.webbeans.contexts.RequestContext;
-import org.jboss.webbeans.contexts.SessionContext;
+import org.jboss.webbeans.context.ApplicationContext;
+import org.jboss.webbeans.context.DependentContext;
+import org.jboss.webbeans.context.RequestContext;
+import org.jboss.webbeans.context.SessionContext;
+import org.jboss.webbeans.context.beanmap.ApplicationBeanMap;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.util.DeploymentProperties;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -21,10 +21,11 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
-import org.jboss.webbeans.contexts.ApplicationContext;
-import org.jboss.webbeans.contexts.DependentContext;
-import org.jboss.webbeans.contexts.RequestContext;
-import org.jboss.webbeans.contexts.SessionContext;
+import org.jboss.webbeans.context.ApplicationContext;
+import org.jboss.webbeans.context.DependentContext;
+import org.jboss.webbeans.context.RequestContext;
+import org.jboss.webbeans.context.SessionContext;
+import org.jboss.webbeans.context.beanmap.SessionBeanMap;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -1,96 +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.servlet;
-
-import java.util.Enumeration;
-
-import javax.servlet.http.HttpSession;
-
-import org.jboss.webbeans.contexts.AbstractBeanMap;
-import org.jboss.webbeans.contexts.ApplicationContext;
-
-/**
- * A BeanMap that uses a HTTP session as backing map
- *
- * @author Nicklas Karlsson
- *
- * @see org.jboss.webbeans.contexts.ApplicationContext
- */
-public class SessionBeanMap extends AbstractBeanMap
-{
- // The HTTP session context to use as backing map
- private HttpSession session;
-
- /**
- * Constructor
- *
- * @param session The HTTP session
- */
- public SessionBeanMap(HttpSession session)
- {
- super();
- this.session = session;
- }
-
- /**
- * @see org.jboss.webbeans.contexts.AbstractBeanMap#getKeyPrefix()
- */
- @Override
- protected String getKeyPrefix()
- {
- return ApplicationContext.class.getName();
- }
-
- /**
- * @see org.jboss.webbeans.contexts.AbstractBeanMap#getAttribute()
- */
- @Override
- protected Object getAttribute(String key)
- {
- return session.getAttribute(key);
- }
-
- /**
- * @see org.jboss.webbeans.contexts.AbstractBeanMap#getAttributeNames()
- */
- @SuppressWarnings("unchecked")
- @Override
- protected Enumeration<String> getAttributeNames()
- {
- return session.getAttributeNames();
- }
-
- /**
- * @see org.jboss.webbeans.contexts.AbstractBeanMap#removeAttributes()
- */
- @Override
- protected void removeAttribute(String key)
- {
- session.removeAttribute(key);
- }
-
- /**
- * @see org.jboss.webbeans.contexts.AbstractBeanMap#setAttribute()
- */
- @Override
- protected void setAttribute(String key, Object instance)
- {
- session.setAttribute(key, instance);
- }
-
-}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/examples/Tests.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/examples/Tests.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/examples/Tests.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -9,7 +9,7 @@
import org.jboss.webbeans.bean.BeanFactory;
import org.jboss.webbeans.bean.ProducerMethodBean;
import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.contexts.DependentContext;
+import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.test.AbstractTest;
import org.testng.annotations.Test;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -9,7 +9,7 @@
import org.jboss.webbeans.bean.ProducerMethodBean;
import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.bindings.CurrentBinding;
+import org.jboss.webbeans.binding.CurrentBinding;
import org.jboss.webbeans.test.annotations.Synchronous;
import org.jboss.webbeans.test.beans.Barn;
import org.jboss.webbeans.test.beans.Cat;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -11,7 +11,7 @@
import javax.webbeans.manager.Bean;
import org.jboss.webbeans.bean.BeanFactory;
-import org.jboss.webbeans.contexts.DependentContext;
+import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.test.beans.Fox;
import org.jboss.webbeans.test.beans.Tuna;
import org.jboss.webbeans.test.beans.TunedTuna;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventBusTest.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -11,7 +11,7 @@
import javax.webbeans.TypeLiteral;
import javax.webbeans.manager.Bean;
-import org.jboss.webbeans.contexts.DependentContext;
+import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.test.beans.AuroraFinch;
import org.jboss.webbeans.test.beans.BananaSpider;
import org.jboss.webbeans.test.beans.BirdCage;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionTests.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionTests.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionTests.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -12,7 +12,7 @@
import javax.webbeans.manager.Bean;
import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.contexts.RequestContext;
+import org.jboss.webbeans.context.RequestContext;
import org.jboss.webbeans.test.beans.Fox;
import org.jboss.webbeans.test.beans.FoxRun;
import org.jboss.webbeans.test.beans.SpiderNest;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -5,7 +5,7 @@
import javax.webbeans.AmbiguousDependencyException;
import javax.webbeans.manager.Bean;
-import org.jboss.webbeans.contexts.DependentContext;
+import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -10,7 +10,7 @@
import javax.webbeans.UnsatisfiedDependencyException;
import javax.webbeans.manager.Bean;
-import org.jboss.webbeans.bindings.CurrentBinding;
+import org.jboss.webbeans.binding.CurrentBinding;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -6,8 +6,8 @@
import javax.webbeans.RequestScoped;
import javax.webbeans.manager.Context;
-import org.jboss.webbeans.contexts.AbstractBeanMapContext;
-import org.jboss.webbeans.contexts.RequestContext;
+import org.jboss.webbeans.context.AbstractBeanMapContext;
+import org.jboss.webbeans.context.RequestContext;
import org.jboss.webbeans.test.beans.FishFarmOffice;
import org.testng.annotations.Test;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -13,7 +13,7 @@
import javax.webbeans.manager.Bean;
import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.bindings.CurrentBinding;
+import org.jboss.webbeans.binding.CurrentBinding;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -14,7 +14,7 @@
import javax.webbeans.NonexistentConstructorException;
import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.bindings.CurrentBinding;
+import org.jboss.webbeans.binding.CurrentBinding;
import org.jboss.webbeans.introspector.AnnotatedConstructor;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.test.annotations.HeavyDuty;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/DependentContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/DependentContextTest.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/DependentContextTest.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -11,7 +11,7 @@
import org.jboss.webbeans.bean.ProducerMethodBean;
import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.contexts.DependentContext;
+import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.test.AbstractTest;
import org.jboss.webbeans.test.SpecAssertion;
import org.jboss.webbeans.test.SpecVersion;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/NormalContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/NormalContextTest.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/NormalContextTest.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -2,7 +2,7 @@
import javax.webbeans.manager.Context;
-import org.jboss.webbeans.contexts.RequestContext;
+import org.jboss.webbeans.context.RequestContext;
import org.jboss.webbeans.test.AbstractTest;
import org.jboss.webbeans.test.SpecAssertion;
import org.jboss.webbeans.test.SpecVersion;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/contexts/PassivatingContextTest.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -5,7 +5,7 @@
import javax.webbeans.UnserializableDependencyException;
import javax.webbeans.manager.Context;
-import org.jboss.webbeans.contexts.RequestContext;
+import org.jboss.webbeans.context.RequestContext;
import org.jboss.webbeans.test.AbstractTest;
import org.jboss.webbeans.test.SpecAssertion;
import org.jboss.webbeans.test.SpecVersion;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanLifecycleTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanLifecycleTest.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanLifecycleTest.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -4,7 +4,7 @@
import org.jboss.webbeans.bean.BeanFactory;
import org.jboss.webbeans.bean.EnterpriseBean;
-import org.jboss.webbeans.contexts.DependentContext;
+import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.test.AbstractTest;
import org.jboss.webbeans.test.SpecAssertion;
import org.jboss.webbeans.test.SpecVersion;
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanRemoveMethodTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanRemoveMethodTest.java 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanRemoveMethodTest.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -6,7 +6,7 @@
import org.jboss.webbeans.bean.BeanFactory;
import org.jboss.webbeans.bean.EnterpriseBean;
-import org.jboss.webbeans.contexts.RequestContext;
+import org.jboss.webbeans.context.RequestContext;
import org.jboss.webbeans.test.AbstractTest;
import org.jboss.webbeans.test.SpecAssertion;
import org.jboss.webbeans.test.SpecVersion;
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 2008-12-26 22:46:18 UTC (rev 736)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java 2008-12-26 22:51:21 UTC (rev 737)
@@ -2,11 +2,11 @@
import org.jboss.webbeans.bootstrap.WebBeansBootstrap;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-import org.jboss.webbeans.contexts.ApplicationContext;
-import org.jboss.webbeans.contexts.DependentContext;
-import org.jboss.webbeans.contexts.RequestContext;
-import org.jboss.webbeans.contexts.SessionContext;
-import org.jboss.webbeans.contexts.SimpleBeanMap;
+import org.jboss.webbeans.context.ApplicationContext;
+import org.jboss.webbeans.context.DependentContext;
+import org.jboss.webbeans.context.RequestContext;
+import org.jboss.webbeans.context.SessionContext;
+import org.jboss.webbeans.context.beanmap.SimpleBeanMap;
import org.jboss.webbeans.resources.spi.ResourceLoader;
public class MockBootstrap extends WebBeansBootstrap
16 years
[webbeans-commits] Webbeans SVN: r736 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-12-26 17:46:18 -0500 (Fri, 26 Dec 2008)
New Revision: 736
Removed:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bindings/
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/exceptions/
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resources/
Log:
Move beanmap stuff to own package
Move to singular naming (contexts -> context etc)
Part I
16 years
[webbeans-commits] Webbeans SVN: r735 - in ri/trunk: webbeans-ri/src/main/java/org/jboss/webbeans/bean and 14 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2008-12-26 16:12:54 -0500 (Fri, 26 Dec 2008)
New Revision: 735
Added:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/SimpleBeanProxyMethodHandler.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapContext.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/valid/LocalGoodDoggie.java
Removed:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java
Modified:
ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/spi/WebBeanDiscovery.java
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/ResourceLoader.java
ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceLoadingException.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/PropertiesBasedBootstrap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/ApplicationContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/BasicContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/ContextMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/DependentContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbDescriptorCache.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/SessionBeanInterceptor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/JSFApiAbstraction.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resources/DefaultNaming.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletApiAbstraction.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletBootstrap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletContextResourceLoader.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ApiAbstraction.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/DeploymentProperties.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanLifecycleTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanRemoveMethodTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/valid/GoodDoggie.java
Log:
* WBRI-84, splitting into AbstractContext and AbstractBeanMapContext.
* JavaDocs/header blocks/comments
* AbstractBeanMapAdaptor -> AbstractBeanMap
* Stub for enterprise client proxy, under construction but doesn't break any tests ;-)
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 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -73,6 +73,8 @@
@Standard
public class ManagerImpl implements Manager, Serializable
{
+ private static final long serialVersionUID = 1L;
+
// The JNDI key to place the manager under
public static final String JNDI_KEY = "java:comp/Manager";
@@ -88,12 +90,13 @@
private ProxyPool proxyPool;
// The registered beans
private List<Bean<?>> beans;
+ // The registered beans, mapped by implementation class
private Map<Class<?>, Bean<?>> beanMap;
// The registered decorators
private Set<Decorator> decorators;
// The registered interceptors
private Set<Interceptor> interceptors;
-
+
private EjbDescriptorCache ejbDescriptorCache;
// The Naming (JNDI) access
@@ -103,7 +106,7 @@
* Constructor
*
* @param enabledDeploymentTypes any enabled deployment types, an empty set
- * if none are specified
+ * if none are specified
*/
public ManagerImpl()
{
@@ -116,7 +119,7 @@
this.contextMap = new ContextMap();
this.eventManager = new EventManager();
this.ejbDescriptorCache = new EjbDescriptorCache();
-
+
List<Class<? extends Annotation>> defaultEnabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
defaultEnabledDeploymentTypes.add(0, Standard.class);
defaultEnabledDeploymentTypes.add(1, Production.class);
@@ -158,7 +161,8 @@
}
/**
- * Resolve the disposal method for the given producer method. For internal use.
+ * Resolve the disposal method for the given producer method. For internal
+ * use.
*
* @param apiType The API type to match
* @param bindingTypes The binding types to match
@@ -193,9 +197,10 @@
{
return Collections.unmodifiableList(enabledDeploymentTypes);
}
-
+
/**
* Set the enabled deployment types
+ *
* @param enabledDeploymentTypes
*/
public void setEnabledDeploymentTypes(List<Class<? extends Annotation>> enabledDeploymentTypes)
@@ -272,7 +277,8 @@
/**
* Wraps a collection of beans into a thread safe list. Since this overwrites
* any existing list of beans in the manager, this should only be done on
- * startup and other controlled situations. For internal use.
+ * startup and other controlled situations. Also maps the beans by
+ * implementation class. For internal use.
*
* @param beans The set of beans to add
* @return A reference to the manager
@@ -289,7 +295,12 @@
resolver.clear();
}
}
-
+
+ /**
+ * Gets the class-mapped beans. For internal use.
+ *
+ * @return The bean map
+ */
public Map<Class<?>, Bean<?>> getBeanMap()
{
return beanMap;
@@ -658,7 +669,7 @@
{
return resolver;
}
-
+
public EjbDescriptorCache getEjbDescriptorCache()
{
return ejbDescriptorCache;
@@ -670,7 +681,8 @@
* @return A string representation
*/
@Override
- public String toString() {
+ public String toString()
+ {
StringBuilder buffer = new StringBuilder();
buffer.append("Manager\n");
buffer.append("Enabled deployment types: " + getEnabledDeploymentTypes() + "\n");
@@ -680,7 +692,7 @@
buffer.append("Registered interceptors: " + interceptors.size() + "\n");
return buffer.toString();
}
-
+
public String toDetailedString()
{
StringBuilder buffer = new StringBuilder();
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -47,6 +47,7 @@
*/
public class Resolver implements Serializable
{
+ private static final long serialVersionUID = 1L;
/**
* Extension of an element which bases equality not only on type, but also on
@@ -54,6 +55,7 @@
*/
private abstract class ResolvableAnnotatedItem<T, S> extends ForwardingAnnotatedItem<T, S> implements Serializable
{
+ private static final long serialVersionUID = 1L;
@Override
public boolean equals(Object other)
@@ -170,6 +172,7 @@
{
registerInjectionPoint(new ResolvableAnnotatedItem<Object, Object>()
{
+ private static final long serialVersionUID = 1L;
@Override
public AnnotatedItem<Object, Object> delegate()
@@ -193,6 +196,7 @@
final ResolvableAnnotatedItem<T, S> element = new ResolvableAnnotatedItem<T, S>()
{
+ private static final long serialVersionUID = 1L;
@Override
public AnnotatedItem<T, S> delegate()
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -252,7 +252,6 @@
* @return The instance
*/
@Override
- @SuppressWarnings("unchecked")
public T create()
{
try
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -0,0 +1,71 @@
+/*
+ * 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.bean.proxy;
+
+import java.lang.reflect.Method;
+
+import javassist.util.proxy.MethodHandler;
+
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.util.Reflections;
+
+/**
+ * Method handler for enterprise bean client proxies
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+public class EnterpriseBeanProxyMethodHandler implements MethodHandler
+{
+ // The log provider
+ private LogProvider log = Logging.getLogProvider(EnterpriseBeanProxyMethodHandler.class);
+ // The container provided proxy that implements all interfaces
+ private Object proxy;
+
+ /**
+ * Constructor
+ *
+ * @param proxy The generic proxy
+ */
+ public EnterpriseBeanProxyMethodHandler(Object proxy)
+ {
+ this.proxy = proxy;
+ log.trace("Created enterprise bean proxy method handler for " + proxy);
+ }
+
+ /**
+ * The method proxy
+ *
+ * Executes the corresponding method on the proxy
+ *
+ * @param self A reference to the proxy
+ * @param method The method to execute
+ * @param process The next method to proceed to
+ * @param args The method calling arguments
+ */
+ @Override
+ public Object invoke(Object self, Method method, Method proceed, Object[] args) throws Throwable
+ {
+ Method proxiedMethod = Reflections.lookupMethod(method, proxy);
+ Object returnValue = Reflections.invokeAndWrap(proxiedMethod, proxy, args);
+ log.trace("Executed " + method + " on " + proxy + " with parameters " + args + " and got return value " + returnValue);
+ return returnValue;
+ }
+
+}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -1,98 +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.bean.proxy;
-
-import java.io.Serializable;
-import java.lang.reflect.Method;
-
-import javassist.util.proxy.MethodHandler;
-
-import javax.webbeans.manager.Bean;
-import javax.webbeans.manager.Context;
-
-import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.util.Reflections;
-
-/**
- * A Javassist MethodHandler that delegates method calls to a proxied bean. If
- * the transient bean has become null, it is looked up from the manager bean
- * list before the invocation.
- *
- * @author Nicklas Karlsson
- *
- * @see org.jboss.webbeans.bean.proxy.ProxyPool
- */
-public class ProxyMethodHandler implements MethodHandler, Serializable
-{
- private static final long serialVersionUID = -5391564935097267888L;
- // The bean
- private transient Bean<?> bean;
- // The bean index in the manager
- private int beanIndex;
-
- /**
- * Constructor
- *
- * @param bean The bean to proxy
- * @param beanIndex The index to the bean in the manager bean list
- */
- public ProxyMethodHandler(Bean<?> bean, int beanIndex)
- {
- this.bean = bean;
- this.beanIndex = beanIndex;
- }
-
- /**
- * The method proxy
- *
- * Uses reflection to look up the corresponding method on the proxy and
- * executes that method with the same parameters.
- *
- * @param self A reference to the proxy
- * @param method The method to execute
- * @param process The next method to proceed to
- * @param args The method calling arguments
- */
- public Object invoke(Object self, Method method, Method proceed, Object[] args) throws Throwable
- {
- //TODO account for child managers
- if (bean == null)
- {
- bean = CurrentManager.rootManager().getBeans().get(beanIndex);
- }
- Context context = CurrentManager.rootManager().getContext(bean.getScopeType());
- Object proxiedInstance = context.get(bean, true);
- Method proxiedMethod = Reflections.lookupMethod(method, proxiedInstance);
- return proxiedMethod.invoke(proxiedInstance, args);
- }
-
- /**
- * Gets a string representation
- *
- * @return The string representation
- */
- @Override
- public String toString()
- {
- StringBuilder buffer = new StringBuilder();
- String beanInfo = bean == null ? "null bean" : bean.toString();
- buffer.append("Proxy method handler for " + beanInfo + " with index " + beanIndex);
- return buffer.toString();
- }
-
-}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -41,14 +41,18 @@
*/
public class ProxyPool implements Serializable
{
+ private static final long serialVersionUID = 1L;
+
/**
* A container/cache for previously created proxies
*
* @author Nicklas Karlsson
*/
-
private ConcurrentCache<Bean<? extends Object>, Object> pool;
+ /**
+ * Constructor
+ */
public ProxyPool()
{
this.pool = new ConcurrentCache<Bean<? extends Object>, Object>();
@@ -130,7 +134,7 @@
{
throw new RuntimeException("Could not access bean correctly when creating client proxy for " + bean, e);
}
- ProxyMethodHandler proxyMethodHandler = new ProxyMethodHandler(bean, beanIndex);
+ SimpleBeanProxyMethodHandler proxyMethodHandler = new SimpleBeanProxyMethodHandler(bean, beanIndex);
((ProxyObject) clientProxy).setHandler(proxyMethodHandler);
return clientProxy;
}
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/SimpleBeanProxyMethodHandler.java (from rev 659, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/SimpleBeanProxyMethodHandler.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/SimpleBeanProxyMethodHandler.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -0,0 +1,105 @@
+/*
+ * 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.bean.proxy;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+
+import javassist.util.proxy.MethodHandler;
+
+import javax.webbeans.manager.Bean;
+import javax.webbeans.manager.Context;
+
+import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.util.Reflections;
+
+/**
+ * A Javassist MethodHandler that delegates method calls to a proxied bean. If
+ * the transient bean has become null, it is looked up from the manager bean
+ * list before the invocation.
+ *
+ * @author Nicklas Karlsson
+ *
+ * @see org.jboss.webbeans.bean.proxy.ProxyPool
+ */
+public class SimpleBeanProxyMethodHandler implements MethodHandler, Serializable
+{
+ private static final long serialVersionUID = -5391564935097267888L;
+ // The log provider
+ private LogProvider log = Logging.getLogProvider(SimpleBeanProxyMethodHandler.class);
+ // The bean
+ private transient Bean<?> bean;
+ // The bean index in the manager
+ private int beanIndex;
+
+ /**
+ * Constructor
+ *
+ * @param bean The bean to proxy
+ * @param beanIndex The index to the bean in the manager bean list
+ */
+ public SimpleBeanProxyMethodHandler(Bean<?> bean, int beanIndex)
+ {
+ this.bean = bean;
+ this.beanIndex = beanIndex;
+ log.trace("Created method handler for bean " + bean + " indexed as " + beanIndex);
+ }
+
+ /**
+ * The method proxy
+ *
+ * Uses reflection to look up the corresponding method on the proxy and
+ * executes that method with the same parameters.
+ *
+ * @param self A reference to the proxy
+ * @param method The method to execute
+ * @param process The next method to proceed to
+ * @param args The method calling arguments
+ */
+ public Object invoke(Object self, Method method, Method proceed, Object[] args) throws Throwable
+ {
+ // TODO account for child managers
+ if (bean == null)
+ {
+ bean = CurrentManager.rootManager().getBeans().get(beanIndex);
+ }
+ Context context = CurrentManager.rootManager().getContext(bean.getScopeType());
+ Object proxiedInstance = context.get(bean, true);
+ Method proxiedMethod = Reflections.lookupMethod(method, proxiedInstance);
+ Object returnValue = proxiedMethod.invoke(proxiedInstance, args);
+ log.trace("Executed method " + proxiedMethod + " on " + proxiedInstance + " with parameters " + args + " and got return value " + returnValue);
+ return returnValue;
+ }
+
+ /**
+ * Gets a string representation
+ *
+ * @return The string representation
+ */
+ @Override
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder();
+ String beanInfo = bean == null ? "null bean" : bean.toString();
+ buffer.append("Proxy method handler for " + beanInfo + " with index " + beanIndex);
+ return buffer.toString();
+ }
+
+}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/PropertiesBasedBootstrap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/PropertiesBasedBootstrap.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/PropertiesBasedBootstrap.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -1,3 +1,20 @@
+/*
+ * 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.bootstrap;
import java.lang.reflect.Constructor;
@@ -23,7 +40,7 @@
*/
public abstract class PropertiesBasedBootstrap extends WebBeansBootstrap
{
-
+ // The log provider
private static final LogProvider log = Logging.getLogProvider(ServletBootstrap.class);
/**
@@ -52,6 +69,13 @@
return null;
}
+ /**
+ * Creates an instance of the type
+ *
+ * @param constructor The constructor to use
+ * @param parameters The parameters to pass to the contstructor
+ * @return An instance of the type
+ */
protected static <T> T newInstance(Constructor<T> constructor, Object... parameters)
{
try
@@ -77,6 +101,8 @@
}
/**
+ * Initializes the naming provider
+ *
* Only safe to call once resourceloader and deployment properties are set
*/
protected void initProperties()
@@ -93,7 +119,13 @@
}
-
+ /**
+ * Gets the deployment properties
+ *
+ * @return The deployment properties
+ *
+ * @see org.jboss.webbeans.util.DeploymentProperties
+ */
protected abstract DeploymentProperties getDeploymentProperties();
}
\ No newline at end of file
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMap.java (from rev 734, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMap.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMap.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -0,0 +1,168 @@
+/*
+ * 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.contexts;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.webbeans.manager.Contextual;
+
+import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.servlet.ApplicationBeanMap;
+
+public abstract class AbstractBeanMap implements BeanMap
+{
+ // The log provider
+ private static LogProvider log = Logging.getLogProvider(ApplicationBeanMap.class);
+
+ /**
+ * Gets a bean from the map
+ *
+ * @param bean The bean to get
+ * @return The instance
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T get(Contextual<? extends T> bean)
+ {
+ String key = getBeanKey(bean);
+ T instance = (T) getAttribute(key);
+ log.trace("Looked for " + key + " and got " + instance);
+ return instance;
+ }
+
+ /**
+ * Removes an instance from the map
+ *
+ * @param bean The bean of the instance to remove
+ * @return The removed instance
+ */
+ public <T> T remove(Contextual<? extends T> bean)
+ {
+ T instance = get(bean);
+ String key = getBeanKey(bean);
+ removeAttribute(key);
+ log.trace("Removed bean under key " + key);
+ return instance;
+ }
+
+ /**
+ * Clears the bean map
+ */
+ @SuppressWarnings("unchecked")
+ public void clear()
+ {
+ Enumeration names = getAttributeNames();
+ while (names.hasMoreElements())
+ {
+ String name = (String) names.nextElement();
+ removeAttribute(name);
+ log.trace("Cleared " + name);
+ }
+ log.trace("Bean Map cleared");
+ }
+
+ /**
+ * Returns the beans present in the map
+ *
+ * @return The beans
+ */
+ @SuppressWarnings("unchecked")
+ public Iterable<Contextual<? extends Object>> keySet()
+ {
+ List<Contextual<?>> beans = new ArrayList<Contextual<?>>();
+ Enumeration names = getAttributeNames();
+ while (names.hasMoreElements())
+ {
+ String name = (String) names.nextElement();
+ if (name.startsWith(getKeyPrefix()))
+ {
+ String id = name.substring(getKeyPrefix().length() + 1);
+ Contextual<?> bean = CurrentManager.rootManager().getBeans().get(Integer.parseInt(id));
+ beans.add(bean);
+ }
+ }
+ return beans;
+ }
+
+ /**
+ * Puts an instance of a bean in the map
+ *
+ * @param bean The key bean
+ * @param instance The instance
+ * @return The instance added
+ */
+ public <T> void put(Contextual<? extends T> bean, T instance)
+ {
+ String key = getBeanKey(bean);
+ setAttribute(key, instance);
+ log.trace("Added bean " + bean + " under key " + key);
+ }
+
+ /**
+ * Gets an attribute from the underlying storage
+ *
+ * @param key The key of the attribute
+ * @return The data
+ */
+ protected abstract Object getAttribute(String key);
+
+ /**
+ * Removes an attribute from the underlying storage
+ *
+ * @param key The attribute to remove
+ */
+ protected abstract void removeAttribute(String key);
+
+ /**
+ * Gets an enumeration of the beans present in the underlying storage
+ *
+ * @return The current beans
+ */
+ protected abstract Enumeration<String> getAttributeNames();
+
+ /**
+ * Sets an instance under a key in the underlying storage
+ *
+ * @param key The key
+ * @param instance The instance
+ */
+ protected abstract void setAttribute(String key, Object instance);
+
+ /**
+ * Gets a key prefix that should be prefixed to names
+ *
+ * @return The prefix
+ */
+ protected abstract String getKeyPrefix();
+
+ /**
+ * Returns a map key to a bean. Uses a known prefix and appends the index of
+ * the Bean in the Manager bean list.
+ *
+ * @param bean The bean to generate a key for.
+ * @return A unique key;
+ */
+ protected String getBeanKey(Contextual<?> bean)
+ {
+ return getKeyPrefix() + "#" + CurrentManager.rootManager().getBeans().indexOf(bean);
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMap.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:mergeinfo
+
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapAdaptor.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -1,168 +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.contexts;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-
-import javax.webbeans.manager.Contextual;
-
-import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.servlet.ApplicationBeanMap;
-
-public abstract class AbstractBeanMapAdaptor implements BeanMap
-{
- // The log provider
- private static LogProvider log = Logging.getLogProvider(ApplicationBeanMap.class);
-
- /**
- * Gets a bean from the map
- *
- * @param bean The bean to get
- * @return The instance
- */
- @SuppressWarnings("unchecked")
- public <T> T get(Contextual<? extends T> bean)
- {
- String key = getBeanKey(bean);
- T instance = (T) getAttribute(key);
- log.trace("Looked for " + key + " and got " + instance);
- return instance;
- }
-
- /**
- * Removes an instance from the map
- *
- * @param bean The bean of the instance to remove
- * @return The removed instance
- */
- public <T> T remove(Contextual<? extends T> bean)
- {
- T instance = get(bean);
- String key = getBeanKey(bean);
- removeAttribute(key);
- log.trace("Removed bean under key " + key);
- return instance;
- }
-
- /**
- * Clears the bean map
- */
- @SuppressWarnings("unchecked")
- public void clear()
- {
- Enumeration names = getAttributeNames();
- while (names.hasMoreElements())
- {
- String name = (String) names.nextElement();
- removeAttribute(name);
- log.trace("Cleared " + name);
- }
- log.trace("Bean Map cleared");
- }
-
- /**
- * Returns the beans present in the map
- *
- * @return The beans
- */
- @SuppressWarnings("unchecked")
- public Iterable<Contextual<? extends Object>> keySet()
- {
- List<Contextual<?>> beans = new ArrayList<Contextual<?>>();
- Enumeration names = getAttributeNames();
- while (names.hasMoreElements())
- {
- String name = (String) names.nextElement();
- if (name.startsWith(getKeyPrefix()))
- {
- String id = name.substring(getKeyPrefix().length() + 1);
- Contextual<?> bean = CurrentManager.rootManager().getBeans().get(Integer.parseInt(id));
- beans.add(bean);
- }
- }
- return beans;
- }
-
- /**
- * Puts an instance of a bean in the map
- *
- * @param bean The key bean
- * @param instance The instance
- * @return The instance added
- */
- public <T> void put(Contextual<? extends T> bean, T instance)
- {
- String key = getBeanKey(bean);
- setAttribute(key, instance);
- log.trace("Added bean " + bean + " under key " + key);
- }
-
- /**
- * Gets an attribute from the underlying storage
- *
- * @param key The key of the attribute
- * @return The data
- */
- protected abstract Object getAttribute(String key);
-
- /**
- * Removes an attribute from the underlying storage
- *
- * @param key The attribute to remove
- */
- protected abstract void removeAttribute(String key);
-
- /**
- * Gets an enumeration of the beans present in the underlying storage
- *
- * @return The current beans
- */
- protected abstract Enumeration<String> getAttributeNames();
-
- /**
- * Sets an instance under a key in the underlying storage
- *
- * @param key The key
- * @param instance The instance
- */
- protected abstract void setAttribute(String key, Object instance);
-
- /**
- * Gets a key prefix that should be prefixed to names
- *
- * @return The prefix
- */
- protected abstract String getKeyPrefix();
-
- /**
- * Returns a map key to a bean. Uses a known prefix and appends the index of
- * the Bean in the Manager bean list.
- *
- * @param bean The bean to generate a key for.
- * @return A unique key;
- */
- protected String getBeanKey(Contextual<?> bean)
- {
- return getKeyPrefix() + "#" + CurrentManager.rootManager().getBeans().indexOf(bean);
- }
-
-}
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapContext.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractBeanMapContext.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -0,0 +1,109 @@
+/*
+ * 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.contexts;
+
+import java.lang.annotation.Annotation;
+
+import javax.webbeans.ContextNotActiveException;
+import javax.webbeans.manager.Bean;
+import javax.webbeans.manager.Contextual;
+
+/**
+ * Base for the Context implementations. Delegates calls to the abstract
+ * getBeanMap and getActive to allow for different implementations (storage
+ * types and ThreadLocal vs. shared)
+ *
+ * @author Nicklas Karlsson
+ * @author Pete Muir
+ *
+ * @see org.jboss.webbeans.contexts.SharedContext
+ * @see org.jboss.webbeans.contexts.BasicContext
+ */
+public abstract class AbstractBeanMapContext extends AbstractContext
+{
+ /**
+ * Constructor
+ *
+ * @param scopeType The scope type
+ */
+ public AbstractBeanMapContext(Class<? extends Annotation> scopeType)
+ {
+ super(scopeType);
+ }
+
+ /**
+ * Get the bean if it exists in the contexts.
+ *
+ * @param create If true, a new instance of the bean will be created if none
+ * exists
+ * @return An instance of the bean
+ * @throws ContextNotActiveException if the context is not active
+ *
+ * @see javax.webbeans.manager.Context#get(Bean, boolean)
+ */
+ public <T> T get(Contextual<T> bean, boolean create)
+ {
+ if (!isActive())
+ {
+ throw new ContextNotActiveException();
+ }
+ T instance = getBeanMap().get(bean);
+ if (instance != null)
+ {
+ return instance;
+ }
+ if (!create)
+ {
+ return null;
+ }
+ instance = bean.create();
+ getBeanMap().put(bean, instance);
+ return instance;
+ }
+
+ /**
+ * Destroys a bean
+ *
+ * @param <T> The type of the bean
+ * @param bean The bean to destroy
+ */
+ private <T> void destroy(Contextual<T> bean)
+ {
+ bean.destroy(getBeanMap().get(bean));
+ }
+
+ /**
+ * Destroys the context
+ */
+ public void destroy()
+ {
+ for (Contextual<? extends Object> bean : getBeanMap().keySet())
+ {
+ destroy(bean);
+ }
+ getBeanMap().clear();
+ }
+
+ /**
+ * A method that should return the actual bean map implementation
+ *
+ * @return The actual bean map
+ */
+ protected abstract BeanMap getBeanMap();
+
+}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -19,26 +19,13 @@
import java.lang.annotation.Annotation;
-import javax.webbeans.ContextNotActiveException;
-import javax.webbeans.manager.Bean;
import javax.webbeans.manager.Context;
-import javax.webbeans.manager.Contextual;
-/**
- * Base for the Context implementations. Delegates calls to the abstract
- * getBeanMap and getActive to allow for different implementations (storage
- * types and ThreadLocal vs. shared)
- *
- * @author Nicklas Karlsson
- * @author Pete Muir
- *
- * @see org.jboss.webbeans.contexts.SharedContext
- * @see org.jboss.webbeans.contexts.BasicContext
- */
public abstract class AbstractContext implements Context
{
// The scope type
private Class<? extends Annotation> scopeType;
+ // The active state of the context
private ThreadLocal<Boolean> active;
/**
@@ -60,36 +47,6 @@
}
/**
- * Get the bean if it exists in the contexts.
- *
- * @param create If true, a new instance of the bean will be created if none
- * exists
- * @return An instance of the bean
- * @throws ContextNotActiveException if the context is not active
- *
- * @see javax.webbeans.manager.Context#get(Bean, boolean)
- */
- public <T> T get(Contextual<T> bean, boolean create)
- {
- if (!isActive())
- {
- throw new ContextNotActiveException();
- }
- T instance = getBeanMap().get(bean);
- if (instance != null)
- {
- return instance;
- }
- if (!create)
- {
- return null;
- }
- instance = bean.create();
- getBeanMap().put(bean, instance);
- return instance;
- }
-
- /**
* Get the scope the context is for
*
* @return The scope type
@@ -124,36 +81,6 @@
}
/**
- * Destroys a bean
- *
- * @param <T> The type of the bean
- * @param bean The bean to destroy
- */
- private <T> void destroy(Contextual<T> bean)
- {
- bean.destroy(getBeanMap().get(bean));
- }
-
- /**
- * Destroys the context
- */
- public void destroy()
- {
- for (Contextual<? extends Object> bean : getBeanMap().keySet())
- {
- destroy(bean);
- }
- getBeanMap().clear();
- }
-
- /**
- * A method that should return the actual bean map implementation
- *
- * @return The actual bean map
- */
- protected abstract BeanMap getBeanMap();
-
- /**
* Delegates to a ThreadLocal instance
*/
protected Boolean getActive()
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/ApplicationContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/ApplicationContext.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/ApplicationContext.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -30,7 +30,7 @@
*
* @see org.jboss.webbeans.contexts.ApplicationContext
*/
-public class ApplicationContext extends AbstractContext
+public class ApplicationContext extends AbstractBeanMapContext
{
public static ApplicationContext INSTANCE = new ApplicationContext();
@@ -97,7 +97,7 @@
{
String active = isActive() ? "Active " : "Inactive ";
String count = getBeanMap() == null ? "" : "holding " + Names.count(getBeanMap().keySet()) + " instances ";
- String prefix = getBeanMap() == null ? "" : "with key prefix " + ((AbstractBeanMapAdaptor) getBeanMap()).getKeyPrefix();
+ String prefix = getBeanMap() == null ? "" : "with key prefix " + ((AbstractBeanMap) getBeanMap()).getKeyPrefix();
return active + "application context " + count + prefix;
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/BasicContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/BasicContext.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/BasicContext.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -32,7 +32,7 @@
* @see org.jboss.webbeans.contexts.ConversationContext
* @see org.jboss.webbeans.contexts.SessionContext
*/
-public abstract class BasicContext extends AbstractContext
+public abstract class BasicContext extends AbstractBeanMapContext
{
// The beans
protected ThreadLocal<BeanMap> beans;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/ContextMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/ContextMap.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/ContextMap.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -38,6 +38,7 @@
*/
public class ContextMap extends ConcurrentCache<Class<? extends Annotation>, List<Context>>
{
+ private static final long serialVersionUID = 1L;
/**
* Gets the dependent context
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/DependentContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/DependentContext.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/DependentContext.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -23,14 +23,12 @@
import javax.webbeans.Dependent;
import javax.webbeans.manager.Contextual;
-import org.jboss.webbeans.util.Names;
-
/**
* The dependent context
*
* @author Nicklas Karlsson
*/
-public class DependentContext extends BasicContext
+public class DependentContext extends AbstractContext
{
public static final DependentContext INSTANCE = new DependentContext();
@@ -75,8 +73,7 @@
public String toString()
{
String active = isActive() ? "Active " : "Inactive ";
- String count = getBeanMap() == null ? "" : "holding " + Names.count(getBeanMap().keySet()) + " instances ";
- return active + "dependent context " + count;
+ return active + "dependent context";
}
@Override
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -28,7 +28,7 @@
*
* @author Nicklas Karlsson
*/
-public class SessionContext extends AbstractContext
+public class SessionContext extends AbstractBeanMapContext
{
private static LogProvider log = Logging.getLogProvider(SessionContext.class);
@@ -74,7 +74,7 @@
{
String active = isActive() ? "Active " : "Inactive ";
String count = getBeanMap() == null ? "" : "holding " + Names.count(getBeanMap().keySet()) + " instances ";
- String prefix = getBeanMap() == null ? "" : "with key prefix " + ((AbstractBeanMapAdaptor) getBeanMap()).getKeyPrefix();
+ String prefix = getBeanMap() == null ? "" : "with key prefix " + ((AbstractBeanMap) getBeanMap()).getKeyPrefix();
return active + "session context " + count + prefix;
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbDescriptorCache.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbDescriptorCache.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/EjbDescriptorCache.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -33,6 +33,7 @@
*/
public class EjbDescriptorCache implements Serializable
{
+ private static final long serialVersionUID = 1L;
// EJB name -> EJB descriptor map
private ConcurrentMap<String, EjbDescriptor<?>> ejbsByName;
@@ -118,17 +119,20 @@
add(ejbDescriptor);
}
}
-
+
+ /**
+ * Clears both maps
+ */
public void clear()
{
ejbsByBeanClass.clear();
ejbsByName.clear();
}
-
+
@Override
public String toString()
{
- return ejbsByBeanClass + "\n" + ejbsByName;
+ return "EJB Descriptor cache has indexed " + ejbsByBeanClass.size() + " EJBs by class and " + ejbsByName + " by name";
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/SessionBeanInterceptor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/SessionBeanInterceptor.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/SessionBeanInterceptor.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -1,3 +1,20 @@
+/*
+ * 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.ejb;
import javax.annotation.PostConstruct;
@@ -8,9 +25,18 @@
import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.bean.EnterpriseBean;
+/**
+ * Interceptor for handling EJB post-construct tasks
+ *
+ * @author Pete Muir
+ */
public class SessionBeanInterceptor
{
-
+ /**
+ * Gets the underlying target and calls the post-construct method
+ *
+ * @param invocationContext The invocation context
+ */
@PostConstruct
public void postConstruct(InvocationContext invocationContext)
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -42,11 +42,14 @@
*/
public class EventManager implements Serializable
{
- /**
+ private static final long serialVersionUID = 1L;
+
+ /**
* An event type -> observer list map
*/
private class RegisteredObserversMap extends ForwardingMap<Class<?>, List<EventObserver<?>>> implements Serializable
{
+ private static final long serialVersionUID = 1L;
// The map delegate
private ConcurrentHashMap<Class<?>, List<EventObserver<?>>> delegate;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/JSFApiAbstraction.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/JSFApiAbstraction.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/JSFApiAbstraction.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -29,7 +29,6 @@
public class JSFApiAbstraction extends ApiAbstraction
{
-
// An UI component
public final Class<?> UICOMPONENT_CLASS;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resources/DefaultNaming.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resources/DefaultNaming.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/resources/DefaultNaming.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -1,3 +1,20 @@
+/*
+ * 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;
import javax.naming.InitialContext;
@@ -6,30 +23,48 @@
import org.jboss.webbeans.resources.spi.Naming;
+/**
+ * The default naming provider
+ *
+ * @author Pete Muir
+ */
public class DefaultNaming implements Naming
{
-
+ private static final long serialVersionUID = 1L;
+ // The initial lookup context
private transient InitialContext initialContext;
-
+
+ /**
+ * Constructor
+ */
public DefaultNaming()
{
- try
+ try
{
this.initialContext = new InitialContext();
}
- catch (NamingException e)
+ catch (NamingException e)
{
- throw new ExecutionException("Could not obtain InitialContext", e);
+ throw new ExecutionException("Could not obtain InitialContext", e);
}
}
-
-
+ /**
+ * Gets the initial context
+ *
+ * @return The initial context
+ */
public InitialContext getInitialContext()
{
return initialContext;
}
-
+
+ /**
+ * 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
@@ -41,7 +76,15 @@
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
+ */
+ @SuppressWarnings("unchecked")
public <T> T lookup(String name, Class<? extends T> expectedType)
{
Object instance;
@@ -57,10 +100,10 @@
{
return (T) instance;
}
- catch (ClassCastException e)
+ catch (ClassCastException e)
{
throw new ExecutionException(instance + " not of expected type " + expectedType, e);
}
}
-
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -21,7 +21,7 @@
import javax.servlet.ServletContext;
-import org.jboss.webbeans.contexts.AbstractBeanMapAdaptor;
+import org.jboss.webbeans.contexts.AbstractBeanMap;
import org.jboss.webbeans.contexts.ApplicationContext;
/**
@@ -31,7 +31,7 @@
*
* @see org.jboss.webbeans.contexts.ApplicationContext
*/
-public class ApplicationBeanMap extends AbstractBeanMapAdaptor
+public class ApplicationBeanMap extends AbstractBeanMap
{
// The servlet context to use as backing map
private ServletContext context;
@@ -48,7 +48,7 @@
}
/**
- * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#getKeyPrefix()
+ * @see org.jboss.webbeans.contexts.AbstractBeanMap#getKeyPrefix()
*/
@Override
protected String getKeyPrefix()
@@ -57,7 +57,7 @@
}
/**
- * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#getAttribute()
+ * @see org.jboss.webbeans.contexts.AbstractBeanMap#getAttribute()
*/
@Override
protected Object getAttribute(String key)
@@ -66,7 +66,7 @@
}
/**
- * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#getAttributeNames()
+ * @see org.jboss.webbeans.contexts.AbstractBeanMap#getAttributeNames()
*/
@SuppressWarnings("unchecked")
@Override
@@ -76,7 +76,7 @@
}
/**
- * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#removeAttributes()
+ * @see org.jboss.webbeans.contexts.AbstractBeanMap#removeAttributes()
*/
@Override
protected void removeAttribute(String key)
@@ -85,7 +85,7 @@
}
/**
- * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#setAttribute()
+ * @see org.jboss.webbeans.contexts.AbstractBeanMap#setAttribute()
*/
@Override
protected void setAttribute(String key, Object instance)
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletApiAbstraction.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletApiAbstraction.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletApiAbstraction.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -1,3 +1,20 @@
+/*
+ * 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.servlet;
import org.jboss.webbeans.resources.spi.ResourceLoader;
@@ -3,4 +20,9 @@
import org.jboss.webbeans.util.ApiAbstraction;
+/**
+ * Abstraction for classes in the Servlet API
+ *
+ * @author Pete Muir
+ */
public class ServletApiAbstraction extends ApiAbstraction
{
@@ -11,7 +33,12 @@
public final Class<?> SERVLET_CONTEXT_LISTENER_CLASS;
public final Class<?> HTTP_SESSION_LISTENER_CLASS;
public final Class<?> SERVLET_REQUEST_LISTENER_CLASS;
-
+
+ /**
+ * Constructor
+ *
+ * @param resourceLoader The root resource loader
+ */
public ServletApiAbstraction(ResourceLoader resourceLoader)
{
super(resourceLoader);
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 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletBootstrap.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -1,6 +1,22 @@
+/*
+ * 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.servlet;
-
import java.lang.reflect.Constructor;
import javax.servlet.ServletContext;
@@ -15,12 +31,20 @@
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.util.DeploymentProperties;
+/**
+ * Bootstrapper for usage within servlet environments
+ *
+ * @author Pete Muir
+ */
public class ServletBootstrap extends PropertiesBasedBootstrap
{
-
+ // The Web Beans manager
private ManagerImpl manager;
+ // The resource loader
private ResourceLoader resourceLoader;
+ // The discover implementation
private WebBeanDiscovery webBeanDiscovery;
+ // The deployment properties
private DeploymentProperties deploymentProperties;
public ServletBootstrap(ServletContext servletContext)
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletContextResourceLoader.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletContextResourceLoader.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletContextResourceLoader.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -1,3 +1,20 @@
+/*
+ * 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.servlet;
import java.io.IOException;
@@ -9,16 +26,35 @@
import org.jboss.webbeans.resources.spi.ResourceLoadingException;
import org.jboss.webbeans.util.EnumerationIterable;
+/**
+ * A resource loader based on a servlet context
+ *
+ * @author Pete Muir
+ *
+ */
public class ServletContextResourceLoader implements ResourceLoader
{
-
+ // The servlet context
private final ServletContext servletContext;
+ /**
+ * Constructor
+ *
+ * @param servletContext The servlet context
+ */
public ServletContextResourceLoader(ServletContext servletContext)
{
this.servletContext = servletContext;
}
+ /**
+ * Creates a class with a given name from the servlet contexts classloader
+ *
+ * @param The FQCN of the class
+ * @return The class
+ *
+ * @see org.jboss.webbeans.resources.spi.ResourceLoader#classForName(String)
+ */
public Class<?> classForName(String name)
{
try
@@ -34,18 +70,27 @@
throw new ResourceLoadingException(e);
}
}
-
+
+ /**
+ * @see org.jboss.webbeans.resources.spi.ResourceLoader#getResource(String)
+ */
public URL getResource(String name)
{
URL resource = getResourceFromServletContext(name);
if (resource == null)
{
String stripped = name.startsWith("/") ? name.substring(1) : name;
- resource = servletContext.getClass().getClassLoader().getResource(name);
+ resource = servletContext.getClass().getClassLoader().getResource(stripped);
}
return resource;
}
+ /**
+ * Gets an resource from the classloader of the servlet context
+ *
+ * @param name The name of the resource
+ * @return An URL to the resource
+ */
private URL getResourceFromServletContext(String name)
{
try
@@ -58,6 +103,9 @@
}
}
+ /**
+ * @see org.jboss.webbeans.resources.spi.ResourceLoader#getResource(String)
+ */
public Iterable<URL> getResources(String name)
{
try
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/SessionBeanMap.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -21,7 +21,7 @@
import javax.servlet.http.HttpSession;
-import org.jboss.webbeans.contexts.AbstractBeanMapAdaptor;
+import org.jboss.webbeans.contexts.AbstractBeanMap;
import org.jboss.webbeans.contexts.ApplicationContext;
/**
@@ -31,7 +31,7 @@
*
* @see org.jboss.webbeans.contexts.ApplicationContext
*/
-public class SessionBeanMap extends AbstractBeanMapAdaptor
+public class SessionBeanMap extends AbstractBeanMap
{
// The HTTP session context to use as backing map
private HttpSession session;
@@ -48,7 +48,7 @@
}
/**
- * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#getKeyPrefix()
+ * @see org.jboss.webbeans.contexts.AbstractBeanMap#getKeyPrefix()
*/
@Override
protected String getKeyPrefix()
@@ -57,7 +57,7 @@
}
/**
- * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#getAttribute()
+ * @see org.jboss.webbeans.contexts.AbstractBeanMap#getAttribute()
*/
@Override
protected Object getAttribute(String key)
@@ -66,7 +66,7 @@
}
/**
- * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#getAttributeNames()
+ * @see org.jboss.webbeans.contexts.AbstractBeanMap#getAttributeNames()
*/
@SuppressWarnings("unchecked")
@Override
@@ -76,7 +76,7 @@
}
/**
- * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#removeAttributes()
+ * @see org.jboss.webbeans.contexts.AbstractBeanMap#removeAttributes()
*/
@Override
protected void removeAttribute(String key)
@@ -85,7 +85,7 @@
}
/**
- * @see org.jboss.webbeans.contexts.AbstractBeanMapAdaptor#setAttribute()
+ * @see org.jboss.webbeans.contexts.AbstractBeanMap#setAttribute()
*/
@Override
protected void setAttribute(String key, Object instance)
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ApiAbstraction.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ApiAbstraction.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ApiAbstraction.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -46,8 +46,12 @@
{
}
-
+ /**
+ * Constructor
+ *
+ * @param resourceLoader The root resource loaderS
+ */
public ApiAbstraction(ResourceLoader resourceLoader)
{
this.resourceLoader = resourceLoader;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -34,6 +34,7 @@
*/
public class ConcurrentCache<K, V> extends ForwardingMap<K, Future<V>> implements Serializable
{
+ private static final long serialVersionUID = 1L;
// The backing map with the value wrapped in a Future instance
private ConcurrentHashMap<K, Future<V>> map;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/DeploymentProperties.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/DeploymentProperties.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/DeploymentProperties.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -154,6 +154,7 @@
* @param propertyName The name of the property to load
* @return A set of classes specified
*/
+ @SuppressWarnings("unchecked")
public static <T> Set<Class<? extends T>> getClasses(DeploymentProperties deploymentProperties, ResourceLoader resourceLoader, String propertyName, Class<T> expectedType)
{
Set<Class<? extends T>> classes = new HashSet<Class<? extends T>>();
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -14,10 +14,11 @@
public class AbstractTest
{
-
protected MockManagerImpl manager;
protected MockBootstrap webBeansBootstrap;
-
+
+ public static boolean visited = false;
+
@BeforeMethod
public final void before()
{
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -6,7 +6,7 @@
import javax.webbeans.RequestScoped;
import javax.webbeans.manager.Context;
-import org.jboss.webbeans.contexts.AbstractContext;
+import org.jboss.webbeans.contexts.AbstractBeanMapContext;
import org.jboss.webbeans.contexts.RequestContext;
import org.jboss.webbeans.test.beans.FishFarmOffice;
import org.testng.annotations.Test;
@@ -26,7 +26,7 @@
public void testGetContextWithNoActiveContextsFails()
{
Context requestContext = new RequestContext() {};
- ((AbstractContext)requestContext).setActive(false);
+ ((AbstractBeanMapContext)requestContext).setActive(false);
manager.addContext(requestContext);
manager.getContext(RequestScoped.class);
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanLifecycleTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanLifecycleTest.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanLifecycleTest.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -2,9 +2,15 @@
import javax.webbeans.UnremovedException;
+import org.jboss.webbeans.bean.BeanFactory;
+import org.jboss.webbeans.bean.EnterpriseBean;
+import org.jboss.webbeans.contexts.DependentContext;
import org.jboss.webbeans.test.AbstractTest;
import org.jboss.webbeans.test.SpecAssertion;
import org.jboss.webbeans.test.SpecVersion;
+import org.jboss.webbeans.test.ejb.valid.GoodDoggie;
+import org.jboss.webbeans.test.ejb.valid.LocalGoodDoggie;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
@@ -22,8 +28,17 @@
@SpecVersion("20081206")
public class EnterpriseBeanLifecycleTest extends AbstractTest
{
-
/**
+ * Initializes the EJB descriptors for the EJBs about to be used
+ */
+ @BeforeMethod
+ public void setupEjbDescriptors()
+ {
+ addToEjbCache(GoodDoggie.class);
+ addToEjbCache(LocalGoodDoggie.class);
+ }
+
+ /**
* When the create() method is called, the Web Bean manager creates and
* returns an enterprise bean proxy
*/
@@ -38,11 +53,17 @@
* When the destroy() method is called, the Web Bean manager calls the Web
* Bean remove method upon the proxy
*/
- @Test(groups = { "enterpriseBeans", "clientProxy", "lifecycle", "stub" })
+ @Test(groups = { "enterpriseBeans", "clientProxy", "lifecycle", "stub"})
@SpecAssertion(section = "6.4")
public void testRemoveMethodCalled()
{
- assert false;
+ visited = false;
+ DependentContext.INSTANCE.setActive(true);
+ EnterpriseBean<GoodDoggie> bean = BeanFactory.createEnterpriseBean(GoodDoggie.class, manager);
+ manager.addBean(bean);
+ GoodDoggie doggie = manager.getInstance(bean);
+ bean.destroy(doggie);
+ assert visited = true;
}
/**
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanRemoveMethodTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanRemoveMethodTest.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/EnterpriseBeanRemoveMethodTest.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -18,6 +18,7 @@
import org.jboss.webbeans.test.ejb.invalid.RussellTerrier;
import org.jboss.webbeans.test.ejb.invalid.Saluki;
import org.jboss.webbeans.test.ejb.invalid.Spitz;
+import org.jboss.webbeans.test.ejb.valid.GoodDoggie;
import org.jboss.webbeans.test.ejb.valid.Koirus;
import org.jboss.webbeans.test.ejb.valid.Toller;
import org.jboss.webbeans.test.ejb.valid.WelshCorgie;
@@ -27,18 +28,20 @@
/**
* Sections
*
- * 3.3.5. Web Bean remove methods
- * 3.3.5.1. Declaring a Web Bean remove method using annotations.
- * 3.3.5.2. Declaring a Web Bean remove method using XML
+ * 3.3.5. Web Bean remove methods 3.3.5.1. Declaring a Web Bean remove method
+ * using annotations. 3.3.5.2. Declaring a Web Bean remove method using XML
* 3.3.5.3. Remove method parameters
- *
+ *
* @author Nicklas Karlsson
*/
@SpecVersion("20081206")
@SuppressWarnings("unused")
public class EnterpriseBeanRemoveMethodTest extends AbstractTest
{
-
+
+ /**
+ * Initializes the EJB descriptors for the EJBs about to be used
+ */
@BeforeMethod
public void setupEjbDescriptors()
{
@@ -52,9 +55,8 @@
addToEjbCache(Toller.class);
addToEjbCache(WelshCorgie.class);
addToEjbCache(Koirus.class);
+ addToEjbCache(GoodDoggie.class);
}
-
- public static boolean visited = false;
/**
* EJB spec
@@ -99,7 +101,6 @@
* DefinitionException is thrown by the Web Bean manager at initialization
* time
*/
- // TODO: sentenced duplicated in previous paragraph in specs
@Test(groups = { "enterpriseBeans", "removeMethod" }, expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3.5")
public void testStatefulEnterpriseBeanWithoutRemoveMethodMustBeDependentScoped()
@@ -113,7 +114,6 @@
* DefinitionException is thrown by the Web Bean manager at initialization
* time
*/
- // TODO: sentenced duplicated in previous paragraph in specs
@Test(groups = { "enterpriseBeans", "removeMethod" })
@SpecAssertion(section = "3.3.5")
public void testStatefulEnterpriseBeanWithoutRemoveMethodMustBeDependentScoped2()
@@ -127,7 +127,6 @@
* the application before the Web Bean manager attempts to destroy the
* instance, an UnremovedException is thrown by the Web Bean manager
*/
- // TODO: sentenced duplicated in previous paragraph in specs
@Test(groups = { "enterpriseBeans", "removeMethod", "stub" }, expectedExceptions = UnremovedException.class)
@SpecAssertion(section = "3.3.5")
public void testStatefulEnterpriseBeanWithoutRemoveMethodMustBeRemovedByApplicationBeforeManager()
@@ -165,9 +164,8 @@
/**
* If the application directly calls an EJB remove method of an instance of
* an enterprise Web Bean that is a stateful session bean and has scope
- *
* @Dependent, the Web Bean manager ignores the instance when instead of
- * destroying it
+ * destroying it
*/
@Test(groups = { "enterpriseBeans", "removeMethod", "lifecycle", "stub" })
@SpecAssertion(section = "3.3.5")
@@ -241,6 +239,13 @@
EnterpriseBean<RussellTerrier> bean = BeanFactory.createEnterpriseBean(RussellTerrier.class, manager);
}
+ @Test(groups = { "enterpriseBeans", "removeMethod" })
+ @SpecAssertion(section = { "3.3.5.1" })
+ public void testDestructorAnnotatedSingleRemoveMethod()
+ {
+ EnterpriseBean<GoodDoggie> bean = BeanFactory.createEnterpriseBean(GoodDoggie.class, manager);
+ }
+
/**
* If a Web Bean remove method is annotated @Initializer or @Produces, has a
* parameter annotated @Disposes, or has a parameter annotated @Observes, a
@@ -293,16 +298,6 @@
EnterpriseBean<JackRussellTerrier> bean = BeanFactory.createEnterpriseBean(JackRussellTerrier.class, manager);
}
- // TODO: where did this come from?
- // @Test(groups = { "enterpriseBeans", "removeMethod" }, expectedExceptions =
- // DefinitionException.class)
- // @SpecAssertion(section = { "3.3.5.1", "3.3.5.2" })
- // public void testMultipleRemoveAnnotationsButNoDestructorFails()
- // {
- // EnterpriseBean<Poodle> bean =
- // BeanFactory.createEnterpriseBean(Poodle.class);
- // }
-
/**
* If an enterprise Web Bean defined using XML does not explicitly declare a
* Web Bean remove method using XML, and exactly one remove method that
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/valid/GoodDoggie.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/valid/GoodDoggie.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/valid/GoodDoggie.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -4,11 +4,14 @@
import javax.ejb.Stateful;
import javax.webbeans.Destructor;
+import org.jboss.webbeans.test.ejb.EnterpriseBeanRemoveMethodTest;
+
@Stateful
-public class GoodDoggie
+public class GoodDoggie implements LocalGoodDoggie
{
@Destructor @Remove
public void bye() {
+ EnterpriseBeanRemoveMethodTest.visited = true;
}
}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/valid/LocalGoodDoggie.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/valid/LocalGoodDoggie.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/valid/LocalGoodDoggie.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.ejb.valid;
+
+import javax.ejb.Local;
+import javax.ejb.Remove;
+
+@Local
+public interface LocalGoodDoggie
+{
+ @Remove
+ public void bye();
+}
Modified: ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/spi/WebBeanDiscovery.java
===================================================================
--- ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/spi/WebBeanDiscovery.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/spi/WebBeanDiscovery.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -28,7 +28,6 @@
*/
public interface WebBeanDiscovery
{
-
public static final String PROPERTY_NAME = WebBeanDiscovery.class.getName();
/**
Modified: 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 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/Naming.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -1,3 +1,20 @@
+/*
+ * 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;
import java.io.Serializable;
@@ -13,12 +30,17 @@
*
* @param <T> The type
* @param name The JNDI name
- * @param expectedType The excpected type
+ * @param expectedType The expected type
* @return The object
*/
- @SuppressWarnings("unchecked")
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);
}
Modified: ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceLoader.java
===================================================================
--- ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceLoader.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceLoader.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -1,3 +1,20 @@
+/*
+ * 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;
import java.net.URL;
@@ -2,12 +19,35 @@
-
+/**
+ * Resource loading/class creation abstraction
+ *
+ * @author Pete Muir
+ *
+ */
public interface ResourceLoader
{
-
+ // Name of the resource loader
public static final String PROPERTY_NAME = ResourceLoader.class.getName();
+ /**
+ * Creates a class from a given FQCN
+ *
+ * @param name The name of the clsas
+ * @return The class
+ */
public Class<?> classForName(String name);
+ /**
+ * Gets a resource as a URL by name
+ *
+ * @param name The name of the resource
+ * @return An URL to the resource
+ */
public URL getResource(String name);
+ /**
+ * Gets resources as URLs by name
+ *
+ * @param name The name of the resource
+ * @return An iterable reference to the URLS
+ */
public Iterable<URL> getResources(String name);
Modified: ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceLoadingException.java
===================================================================
--- ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceLoadingException.java 2008-12-26 18:28:04 UTC (rev 734)
+++ ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceLoadingException.java 2008-12-26 21:12:54 UTC (rev 735)
@@ -5,24 +5,50 @@
import javax.webbeans.ExecutionException;
+/**
+ * Exception thrown when errors occur while loading resource
+ *
+ * @author Pete Muir
+ *
+ */
public class ResourceLoadingException extends ExecutionException
{
+ private static final long serialVersionUID = 1L;
+ /**
+ * Constructor
+ */
public ResourceLoadingException()
{
super();
}
+ /**
+ * Constructor
+ *
+ * @param message The message
+ * @param throwable The exception
+ */
public ResourceLoadingException(String message, Throwable throwable)
{
super(message, throwable);
}
+ /**
+ * Constructor
+ *
+ * @param message The message
+ */
public ResourceLoadingException(String message)
{
super(message);
}
+ /**
+ * Constructor
+ *
+ * @param throwable The exception
+ */
public ResourceLoadingException(Throwable throwable)
{
super(throwable);
16 years
[webbeans-commits] Webbeans SVN: r734 - doc/trunk/reference/it-IT/modules.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2008-12-26 13:28:04 -0500 (Fri, 26 Dec 2008)
New Revision: 734
Modified:
doc/trunk/reference/it-IT/modules/interceptors.po
Log:
WBRI-69: Italian translation for Web Beans
Modified: doc/trunk/reference/it-IT/modules/interceptors.po
===================================================================
--- doc/trunk/reference/it-IT/modules/interceptors.po 2008-12-26 12:43:35 UTC (rev 733)
+++ doc/trunk/reference/it-IT/modules/interceptors.po 2008-12-26 18:28:04 UTC (rev 734)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-12-19 20:26+0000\n"
-"PO-Revision-Date: 2008-12-26 13:43+0100\n"
+"PO-Revision-Date: 2008-12-26 19:27+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -109,7 +109,7 @@
#: interceptors.xml:51
#, no-c-format
msgid "Suppose we want to declare that some of our Web Beans are transactional. The first thing we need is an <emphasis>interceptor binding annotation</emphasis> to specify exactly which Web Beans we're interested in:"
-msgstr ""
+msgstr "Si supponga di voler dichiarare transazionali alcuni Web Beans. La prima cosa necessaria è un'<emphasis>annotazione di interceptor binding</emphasis> per specificare esattamente quali Web Beans sono interessati:"
#. Tag: programlisting
#: interceptors.xml:55
@@ -129,7 +129,7 @@
#: interceptors.xml:57
#, no-c-format
msgid "Now we can easily specify that our <literal>ShoppingCart</literal> is a transactional object:"
-msgstr ""
+msgstr "Ora è facilmente possibile specificare che <literal>ShoppingCart</literal> è un oggetto transazionale:"
#. Tag: programlisting
#: interceptors.xml:60
@@ -169,7 +169,7 @@
#: interceptors.xml:71
#, no-c-format
msgid "That's great, but somewhere along the line we're going to have to actually implement the interceptor that provides this transaction management aspect. All we need to do is create a standard EJB interceptor, and annotate it <literal>@Interceptor</literal> and <literal>@Transactional</literal>."
-msgstr ""
+msgstr "Bene, ma da qualche parte è necessario implementare l'interceptor che fornisce l'aspect di gestione della transazione. Occore quindi creare un interceptor EJB standard e annotarlo con <literal>@Interceptor</literal> e <literal>@Transactional</literal>.\""
#. Tag: programlisting
#: interceptors.xml:76
@@ -189,7 +189,7 @@
#: interceptors.xml:78
#, no-c-format
msgid "All Web Beans interceptors are simple Web Beans, and can take advantage of dependency injection and contextual lifecycle management."
-msgstr ""
+msgstr "Tutti gli interceptor dei Web Beans sono Web Beans semplici e possono sfruttare la dependency injection e la gestione del ciclo di vita contestuale."
#. Tag: programlisting
#: interceptors.xml:81
@@ -217,7 +217,7 @@
#: interceptors.xml:83
#, no-c-format
msgid "Multiple interceptors may use the same interceptor binding type."
-msgstr ""
+msgstr "Diverso interceptor possono usare lo stesso tipo di interceptor binding."
#. Tag: title
#: interceptors.xml:88
@@ -229,7 +229,7 @@
#: interceptors.xml:90
#, no-c-format
msgid "Finally, we need to <emphasis>enable</emphasis> our interceptor in <literal>web-beans.xml</literal>."
-msgstr ""
+msgstr "Infine occorre <emphasis>abilitare</emphasis> l'interceptor in <literal>web-beans.xml</literal>."
#. Tag: programlisting
#: interceptors.xml:93
@@ -253,25 +253,25 @@
#: interceptors.xml:97
#, no-c-format
msgid "Well, the XML declaration solves two problems:"
-msgstr ""
+msgstr "La dichiarazione XML risolve due problemi:"
#. Tag: para
#: interceptors.xml:101
#, no-c-format
msgid "it enables us to specify a total ordering for all the interceptors in our system, ensuring deterministic behavior, and"
-msgstr ""
+msgstr "Ci consente di specificare un ordinamento totale per tutti gli interceptor del sistema, assicurando un comportamente deterministico, e"
#. Tag: para
#: interceptors.xml:105
#, no-c-format
msgid "it lets us enable or disable interceptor classes at deployment time."
-msgstr ""
+msgstr "consente di abilitare o disabilitare le classi di interceptor a deployment time."
#. Tag: para
#: interceptors.xml:109
#, no-c-format
msgid "For example, we could specify that our security interceptor runs before our <literal>TransactionInterceptor</literal>."
-msgstr ""
+msgstr "Per esempio è possibile specificare che l'interceptor di sicurezza venga eseguito prima di <literal>TransactionInterceptor</literal>.\""
#. Tag: programlisting
#: interceptors.xml:112
@@ -485,7 +485,7 @@
#: interceptors.xml:173
#, no-c-format
msgid "Interceptor binding type inheritance"
-msgstr ""
+msgstr "Ereditarietà del tipo di interceptor binding"
#. Tag: para
#: interceptors.xml:175
16 years
[webbeans-commits] Webbeans SVN: r733 - doc/trunk/reference/it-IT/modules.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2008-12-26 07:43:35 -0500 (Fri, 26 Dec 2008)
New Revision: 733
Modified:
doc/trunk/reference/it-IT/modules/interceptors.po
Log:
WBRI-69: Italian translation for Web Beans
Modified: doc/trunk/reference/it-IT/modules/interceptors.po
===================================================================
--- doc/trunk/reference/it-IT/modules/interceptors.po 2008-12-26 12:04:01 UTC (rev 732)
+++ doc/trunk/reference/it-IT/modules/interceptors.po 2008-12-26 12:43:35 UTC (rev 733)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-12-19 20:26+0000\n"
-"PO-Revision-Date: 2008-12-20 16:43+0100\n"
+"PO-Revision-Date: 2008-12-26 13:43+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -23,43 +23,44 @@
#: interceptors.xml:6
#, no-c-format
msgid "Web Beans re-uses the basic interceptor architecture of EJB 3.0, extending the functionality in two directions:"
-msgstr ""
+msgstr "Web Beans riutilizza l'architettura base degli interceptor di EJB3.0, estendendo la funzionalità in due direzioni:"
#. Tag: para
#: interceptors.xml:11
#, no-c-format
msgid "Any Web Bean may have interceptors, not just session beans."
-msgstr ""
+msgstr "Qualsiasi Web Bean può avere interceptor, non solo i session bean."
#. Tag: para
#: interceptors.xml:14
#, no-c-format
msgid "Web Beans features a more sophisticated annotation-based approach to binding interceptors to Web Beans."
-msgstr ""
+msgstr "Web Bean fornisce un più sofisticato approccio basato su annotazioni per associare interceptor ai Web Beans."
#. Tag: para
#: interceptors.xml:22
#, no-c-format
msgid "The EJB specification defines two kinds of interception points:"
-msgstr ""
+msgstr "\"La specifica Web Bean definisce due tipi di punti di intercettazione:"
#. Tag: para
#: interceptors.xml:26
#, no-c-format
msgid "business method interception, and"
-msgstr ""
+msgstr "intercettazione del metodo di business, e"
+# lifecycle callback interception = ?
#. Tag: para
#: interceptors.xml:29
#, no-c-format
msgid "lifecycle callback interception."
-msgstr ""
+msgstr "intercettazione della chiamata del ciclo di vita."
#. Tag: para
#: interceptors.xml:33
#, no-c-format
msgid "A <emphasis>business method interceptor</emphasis> applies to invocations of methods of the Web Bean by clients of the Web Bean:"
-msgstr ""
+msgstr "Un <emphasis>interceptor di un metodo di business</emphasis> si applica alle invocazioni di metodi del Web Bean da parte di client del Web Bean:"
#. Tag: programlisting
#: interceptors.xml:36
@@ -73,11 +74,12 @@
" @AroundInvoke public Object manageTransaction(InvocationContext ctx) { ... }\n"
"}]]>"
+# rivedere la frase
#. Tag: para
#: interceptors.xml:38
#, no-c-format
msgid "A <emphasis>lifecycle callback interceptor</emphasis> applies to invocations of lifecycle callbacks by the container:"
-msgstr ""
+msgstr "Un <emphasis>interceptor di chiamata del ciclo di vita</emphasis> si applica alle invocazioni delle chiamate del ciclo di vita da parte del container:"
#. Tag: programlisting
#: interceptors.xml:41
@@ -95,13 +97,13 @@
#: interceptors.xml:43
#, no-c-format
msgid "An interceptor class may intercept both lifecycle callbacks and business methods."
-msgstr ""
+msgstr "Una classe interceptor può intercettare entrambi le chiamate del ciclo di vita ed i metodi di business."
#. Tag: title
#: interceptors.xml:49
#, no-c-format
msgid "Interceptor bindings"
-msgstr ""
+msgstr "Interceptor bindings"
#. Tag: para
#: interceptors.xml:51
@@ -143,7 +145,7 @@
#: interceptors.xml:62
#, no-c-format
msgid "Or, if we prefer, we can specify that just one method is transactional:"
-msgstr ""
+msgstr "O se si preferisce, si può specificare che solo un metodo sia transazionale:"
#. Tag: programlisting
#: interceptors.xml:64
@@ -161,7 +163,7 @@
#: interceptors.xml:69
#, no-c-format
msgid "Implementing interceptors"
-msgstr ""
+msgstr "Implementare gli interceptor"
#. Tag: para
#: interceptors.xml:71
@@ -221,7 +223,7 @@
#: interceptors.xml:88
#, no-c-format
msgid "Enabling interceptors"
-msgstr ""
+msgstr "Abilitare gli interceptor"
#. Tag: para
#: interceptors.xml:90
@@ -529,7 +531,7 @@
#: interceptors.xml:195
#, no-c-format
msgid "Use of <literal>@Interceptors</literal>"
-msgstr ""
+msgstr "Uso di <literal>@Interceptors</literal>"
#. Tag: para
#: interceptors.xml:197
16 years
[webbeans-commits] Webbeans SVN: r732 - doc/trunk/reference/it-IT/modules.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2008-12-26 07:04:01 -0500 (Fri, 26 Dec 2008)
New Revision: 732
Modified:
doc/trunk/reference/it-IT/modules/scopescontexts.po
Log:
WBRI-69: Italian translation for Web Beans
Modified: doc/trunk/reference/it-IT/modules/scopescontexts.po
===================================================================
--- doc/trunk/reference/it-IT/modules/scopescontexts.po 2008-12-25 21:18:03 UTC (rev 731)
+++ doc/trunk/reference/it-IT/modules/scopescontexts.po 2008-12-26 12:04:01 UTC (rev 732)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-12-19 20:26+0000\n"
-"PO-Revision-Date: 2008-12-20 18:03+0100\n"
+"PO-Revision-Date: 2008-12-26 13:03+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -17,49 +17,49 @@
#: scopescontexts.xml:4
#, no-c-format
msgid "Scopes and contexts"
-msgstr ""
+msgstr "Scope e contesti"
#. Tag: para
#: scopescontexts.xml:6
#, no-c-format
msgid "So far, we've seen a few examples of <emphasis>scope type annotations</emphasis>. The scope of a Web Bean determines the lifecycle of instances of the Web Bean. The scope also determines which clients refer to which instances of the Web Bean. According to the Web Beans specification, a scope determines:"
-msgstr ""
+msgstr "Finora si sono visti pochi esempi di <emphasis>annotazioni di tipi di scope</emphasis>. Gli scope di un Web Bean determinano il ciclo di vita del Web Bean. Lo scope determina anche quali client fanno riferimento a quali istanze di Web Bean. Secondo la specifica Web Bean, uno scope determina:"
#. Tag: para
#: scopescontexts.xml:14
#, no-c-format
msgid "When a new instance of any Web Bean with that scope is created"
-msgstr ""
+msgstr "Quando una nuova istanza di un Web Bean con tale scope viene creata"
#. Tag: para
#: scopescontexts.xml:17
#, no-c-format
msgid "When an existing instance of any Web Bean with that scope is destroyed"
-msgstr ""
+msgstr "Quando un'istanza esistente di un Web Bean con tale scope viene distrutta"
#. Tag: para
#: scopescontexts.xml:20
#, no-c-format
msgid "Which injected references refer to any instance of a Web Bean with that scope"
-msgstr ""
+msgstr "Quali riferimenti iniettati puntano a istanze di un Web Bean con tale scope"
#. Tag: para
#: scopescontexts.xml:25
#, no-c-format
msgid "For example, if we have a session scoped Web Bean, <literal>CurrentUser</literal>, all Web Beans that are called in the context of the same <literal>HttpSession</literal> will see the same instance of <literal>CurrentUser</literal>. This instance will be automatically created the first time a <literal>CurrentUser</literal> is needed in that session, and automatically destroyed when the session ends."
-msgstr ""
+msgstr "Per esempio, se esiste un Web Bean con scope di sessione, <literal>CurrentUser</literal>, tutti i Web Bean che vengono chiamati nel contesto della medesima <literal>HttpSession</literal> vedranno la stessa istanza di <literal>CurrentUser</literal>. Quest'istanza verrà automaticamente creata la prima volta che in tale sessione occorre <literal>CurrentUser</literal>, e verrà distrutta automaticamente quando la sessione termina. "
#. Tag: title
#: scopescontexts.xml:32
#, no-c-format
msgid "Scope types"
-msgstr ""
+msgstr "Tipi di scope"
#. Tag: para
#: scopescontexts.xml:34
#, no-c-format
msgid "Web Beans features an <emphasis>extensible context model</emphasis>. It is possible to define new scopes by creating a new scope type annotation:"
-msgstr ""
+msgstr "Web Bean fornisce un <emphasis>modello di contesto estensibile</emphasis>. E' possibile definire nuovi scope creando una nuova annotazione di un tipo di scope."
#. Tag: programlisting
#: scopescontexts.xml:37
@@ -79,13 +79,13 @@
#: scopescontexts.xml:39
#, no-c-format
msgid "Of course, that's the easy part of the job. For this scope type to be useful, we will also need to define a <literal>Context</literal> object that implements the scope! Implementing a <literal>Context</literal> is usually a very technical task, intended for framework development only."
-msgstr ""
+msgstr "Sicuramente questa è la parte facile del lavoro. Affinché questo tipo di scope sia utile, avremo bisogno di definire un oggetto <literal>Contesto</literal> che implementi lo scope! Implementare un <literal>Contesto</literal> è compito molto tecnico, inteso solo per lo sviluppo di framework."
#. Tag: para
#: scopescontexts.xml:44
#, no-c-format
msgid "We can apply a scope type annotation to a Web Bean implementation class to specify the scope of the Web Bean:"
-msgstr ""
+msgstr "Si può applicare un'annotazione con un tipo scope ad una classe di implementazione Web Bean per specificare lo scope del Web Bean:"
#. Tag: programlisting
#: scopescontexts.xml:47
@@ -101,19 +101,19 @@
#: scopescontexts.xml:58
#, no-c-format
msgid "Usually, you'll use one of Web Beans' built-in scopes."
-msgstr ""
+msgstr "Solitamente si userà uno degli scopi predefiniti di Web Beans."
#. Tag: title
#: scopescontexts.xml:63
#, no-c-format
msgid "Built-in scopes"
-msgstr ""
+msgstr "Scope predefiniti"
#. Tag: para
#: scopescontexts.xml:65
#, no-c-format
msgid "Web Beans defines four built-in scopes:"
-msgstr ""
+msgstr "Web Beans definisce quattro scope predefiniti:"
#. Tag: literal
#: scopescontexts.xml:69
@@ -143,109 +143,109 @@
#: scopescontexts.xml:82
#, no-c-format
msgid "For a web application that uses Web Beans:"
-msgstr ""
+msgstr "Per un'applicazione web che impiega Web Beans:"
#. Tag: para
#: scopescontexts.xml:86
#, no-c-format
msgid "any servlet request has access to active request, session and application scopes, and, additionally"
-msgstr ""
+msgstr "qualsiasi richiesta servlet ha accesso a scope attivi di richiesta, sessione e applicazione e, in aggiunta"
#. Tag: para
#: scopescontexts.xml:90
#, no-c-format
msgid "any JSF request has access to an active conversation scope."
-msgstr ""
+msgstr "qualsiasi richiesta JSF ha accesso allo scope attivo di conversazione."
#. Tag: para
#: scopescontexts.xml:94
#, no-c-format
msgid "The request and application scopes are also active:"
-msgstr ""
+msgstr "Gli scope di richiesta ed applicazione sono pure attivi:"
#. Tag: para
#: scopescontexts.xml:98
#, no-c-format
msgid "during invocations of EJB remote methods,"
-msgstr ""
+msgstr "durante le invocazioni a metodi remoti EJB,"
#. Tag: para
#: scopescontexts.xml:101
#, no-c-format
msgid "during EJB timeouts,"
-msgstr ""
+msgstr "durante i timeout EJB,"
#. Tag: para
#: scopescontexts.xml:104
#, no-c-format
msgid "during message delivery to a message-driven bean, and"
-msgstr ""
+msgstr "durante la consegna dei messaggi a bean message-drive, e"
#. Tag: para
#: scopescontexts.xml:107
#, no-c-format
msgid "during web service invocations."
-msgstr ""
+msgstr "durante invocazioni web service."
#. Tag: para
#: scopescontexts.xml:111
#, no-c-format
msgid "If the application tries to invoke a Web Bean with a scope that does not have an active context, a <literal>ContextNotActiveException</literal> is thrown by the Web Bean manager at runtime."
-msgstr ""
+msgstr "Se l'applicazione prova ad invocare un Web Bean con scope che non ha un contesto attivo, una <literal>ContextNotActiveException</literal> viene lanciata a runtime dal manager Web Bean."
#. Tag: para
#: scopescontexts.xml:115
#, no-c-format
msgid "Three of the four built-in scopes should be extremely familiar to every Java EE developer, so let's not waste time discussing them here. One of the scopes, however, is new."
-msgstr ""
+msgstr "Tre dei quattro scope predefiniti dovrebbero essere estremamente familiari ad ogni sviluppatore Java EE, quindi non si procede oltre nella discussione. Uno degli scope è comunque nuovo."
#. Tag: title
#: scopescontexts.xml:122
#, no-c-format
msgid "The conversation scope"
-msgstr ""
+msgstr "Lo scope conversazione"
#. Tag: para
#: scopescontexts.xml:124
#, no-c-format
msgid "The Web Beans conversation scope is a bit like the traditional session scope in that it holds state associated with a user of the system, and spans multiple requests to the server. However, unlike the session scope, the conversation scope:"
-msgstr ""
+msgstr "Lo scope di conversazione di Web Beans è un pò come il tradizionale scope di sessione in cui viene mantenuto lo stato associato all'utente del sistema, e vengono create richiest multiple al server. Comunque, a differenza dello scope di sessione, lo scope di conversazione:"
#. Tag: para
#: scopescontexts.xml:130
#, no-c-format
msgid "is demarcated explicitly by the application, and"
-msgstr ""
+msgstr "è demarcato esplicitamente dall'applicazione, e"
#. Tag: para
#: scopescontexts.xml:133
#, no-c-format
msgid "holds state associated with a particular web browser tab in a JSF application."
-msgstr ""
+msgstr "mantiene lo stato associato ad un particolare tab del browser in un'applicazione JSF."
#. Tag: para
#: scopescontexts.xml:138
#, no-c-format
msgid "A conversation represents a task, a unit of work from the point of view of the user. The conversation context holds state associated with what the user is currently working on. If the user is doing multiple things at the same time, there are multiple conversations."
-msgstr ""
+msgstr "Una conversazione rappresenta un task, un'unità di lavoro dal punto di vista dell'utente. Il contesto di conversazione mantiene uno stato associato all'utente che sta lavorando. Se l'utente sta facendo più cose contemporaneamente ci saranno più conversazioni."
#. Tag: para
#: scopescontexts.xml:143
#, no-c-format
msgid "The conversation context is active during any JSF request. However, most conversations are destroyed at the end of the request. If a conversation should hold state across multiple requests, it must be explicitly promoted to a <emphasis>long-running conversation</emphasis>."
-msgstr ""
+msgstr "Il contesto di conversazione è attivo durante ogni richiesta JSF. Comunque, la maggior parte delle conversazioni vengono distrutte alla fine della richiesta. Se una conversazione deve mantenere lo stato nel corso richieste multiple, deve esplicitamente essere promossa a <emphasis>conversazione long-running</emphasis>."
#. Tag: title
#: scopescontexts.xml:149
#, no-c-format
msgid "Conversation demarcation"
-msgstr ""
+msgstr "Demarcazione della conversazione"
#. Tag: para
#: scopescontexts.xml:151
#, no-c-format
msgid "Web Beans provides a built-in Web Bean for controlling the lifecyle of conversations in a JSF application. This Web Bean may be obtained by injection:"
-msgstr ""
+msgstr "Web Beans fornisce un Web Bean predefinito per controllare il ciclo di vita delle conversazioni in un'applicazione JSF. QUesto Web Bean può essere ottenuto per iniezione:"
#. Tag: programlisting
#: scopescontexts.xml:154
@@ -257,13 +257,13 @@
#: scopescontexts.xml:156
#, no-c-format
msgid "To promote the conversation associated with the current request to a long-running conversation, call the <literal>begin()</literal> method from application code. To schedule the current long-running conversation context for destruction at the end of the current request, call <literal>end()</literal>."
-msgstr ""
+msgstr "Per promuovere a long-running la conversazione associata alla richiesta corrente, occorre chiamare il metodo <literal>begin()</literal> dal codice dell'applicazione. Per schedulare la distruzione del contesto attuale della conversazione long-running, si chiami <literal>end()</literal>."
#. Tag: para
#: scopescontexts.xml:161
#, no-c-format
msgid "In the following example, a conversation-scoped Web Bean controls the conversation with which it is associated:"
-msgstr ""
+msgstr "Nel seguente esempio un Web Bean con scope di conversazione controlla la conversazione alla quale è associato:"
#. Tag: programlisting
#: scopescontexts.xml:164
@@ -335,31 +335,31 @@
#: scopescontexts.xml:166
#, no-c-format
msgid "This Web Bean is able to control its own lifecycle through use of the <literal>Conversation</literal> API. But some other Web Beans have a lifecycle which depends completely upon another object."
-msgstr ""
+msgstr "Questo Web Bean è capace di controlla il proprio ciclo di vita attraverso l'uso della API <literal>Conversation</literal>. Ma altri Web BEan hanno un ciclo di vita che dipende completamente da un altro oggetto."
#. Tag: title
#: scopescontexts.xml:173
#, no-c-format
msgid "Conversation propagation"
-msgstr ""
+msgstr "Propagazione della conversazione"
#. Tag: para
#: scopescontexts.xml:175
#, no-c-format
msgid "The conversation context automatically propagates with any JSF faces request (JSF form submission). It does not automatically propagate with non-faces requests, for example, navigation via a link."
-msgstr ""
+msgstr "Il contesto di conversazione viene automaticamente propagato con ogni richiesta JSF faces (invio di form JSF). Non si propaga in modo automatico con richiesta non-faces, per esempio, navigazione tramite un link."
#. Tag: para
#: scopescontexts.xml:179
#, no-c-format
msgid "We can force the conversation to propagate with a non-faces request by including the unique identifier of the conversation as a request parameter. The Web Beans specification reserves the request parameter named <literal>cid</literal> for this use. The unique identifier of the conversation may be obtained from the <literal>Conversation</literal> object, which has the Web Beans name <literal>conversation</literal>."
-msgstr ""
+msgstr "E' possibile forzare la conversazione da propagare tramite richiesta non-faces attraverso l'inclusione di un identificatore univoco della conversazione come parametro di richiesta. La specifica Web Bean riserva un parametro di richiesta chiamato <literal>cid</literal> per tale uso. L'identificatore univoco della conversazione può essere ottenuto dall'oggetto <literal>Conversation</literal>, che ha il nome Web Beans <literal>conversation</literal>."
#. Tag: para
#: scopescontexts.xml:186
#, no-c-format
msgid "Therefore, the following link propagates the conversation:"
-msgstr ""
+msgstr "Quindi il seguente link propaga la conversazione:"
#. Tag: programlisting
#: scopescontexts.xml:188
@@ -371,25 +371,25 @@
#: scopescontexts.xml:190
#, no-c-format
msgid "The Web Bean manager is also required to propagate conversations across any redirect, even if the conversation is not marked long-running. This makes it very easy to implement the common POST-then-redirect pattern, without resort to fragile constructs such as a \"flash\" object. In this case, the Web Bean manager automatically adds a request parameter to the redirect URL."
-msgstr ""
+msgstr "Il manager Web Bean deve propagare le conversazioni attraverso i redirect, anche se la conversazione non è marcata long-running. Questo rende facile implementare il comune pattern POST-then-redirect, senza impiegare fragili costrutti quali oggetti \"flash\". In questo caso il manager Web Bean aggiunge automaticamente un parametro di richiesta all'URL di redirect."
#. Tag: title
#: scopescontexts.xml:200
#, no-c-format
msgid "Conversation timeout"
-msgstr ""
+msgstr "Timeout della conversazione"
#. Tag: para
#: scopescontexts.xml:202
#, no-c-format
msgid "The Web Bean manager is permitted to destroy a conversation and all state held in its context at any time in order to preserve resources. A Web Bean manager implementation will normally do this on the basis of some kind of timeout—though this is not required by the Web Beans specification. The timeout is the period of inactivity before the conversation is destroyed."
-msgstr ""
+msgstr "Al manager Web Bean è permesso di distruggere una conversazione e tutto lo stato mantenuto nel contesto in qualsiasi momento al fine di preservare le risorse. Un'implementazione di un manager Web Bean eseguirà questo sulla base di un qualche timeout—sebbene non sia richiesto dalla specifica Web Beans. Il timeout è il periodo di inattività prima che la conversazione venga distrutta."
#. Tag: para
#: scopescontexts.xml:208
#, no-c-format
msgid "The <literal>Conversation</literal> object provides a method to set the timeout. This is a hint to the Web Bean manager, which is free to ignore the setting."
-msgstr ""
+msgstr "L'oggetto <literal>Conversation</literal> fornisce un metodo per impostare iltimeout. Questo è solo un suggerimento al manager Web Bean, che è libero di ignorare quest'impostazione."
#. Tag: programlisting
#: scopescontexts.xml:212
@@ -401,19 +401,19 @@
#: scopescontexts.xml:219
#, no-c-format
msgid "The dependent pseudo-scope"
-msgstr ""
+msgstr "Pseudo-scope dipendente"
#. Tag: para
#: scopescontexts.xml:221
#, no-c-format
msgid "In addition to the four built-in scopes, Web Beans features the so-called <emphasis>dependent pseudo-scope</emphasis>. This is the default scope for a Web Bean which does not explicitly declare a scope type."
-msgstr ""
+msgstr "In aggiunta ai quattro scope predefiniti, Web Bean fornisce il cosiddetto <emphasis>pseudo-scope dipendente</emphasis>. Questo è lo scope di default per un Web Bean che non dichiara esplicitamente un tipo di scope."
#. Tag: para
#: scopescontexts.xml:225
#, no-c-format
msgid "For example, this Web Bean has the scope type <literal>@Dependent</literal>:"
-msgstr ""
+msgstr "Per esempio questo Web Bean ha uno scope di tipo <literal>@Dependent</literal>:"
#. Tag: programlisting
#: scopescontexts.xml:227
@@ -425,31 +425,31 @@
#: scopescontexts.xml:229
#, no-c-format
msgid "When an injection point of a Web Bean resolves to a dependent Web Bean, a new instance of the dependent Web Bean is created every time the first Web Bean is instantiated. Instances of dependent Web Beans are never shared between different Web Beans or different injection points. They are <emphasis>dependent objects</emphasis> of some other Web Bean instance."
-msgstr ""
+msgstr "Quando un punto di iniezione di un Web Bean risolve verso un Web Bean dipendente, viene creata una nuova istanza di Web Bean dipendente ogni volta che il primo Web Bean viene istanziato. Le istanze dei Web Beans dipendenti non vengono mai condivise tra Web Bean differenti o punti di iniezione differenti. Sono <emphasis>oggetti dipendenti</emphasis> di altre istanze Web Bean."
#. Tag: para
#: scopescontexts.xml:235
#, no-c-format
msgid "Dependent Web Bean instances are destroyed when the instance they depend upon is destroyed."
-msgstr ""
+msgstr "Istanze Web Bean dipendenti vengono distrutte quando viene distrutta l'istanza da cui dipendono."
#. Tag: para
#: scopescontexts.xml:243
#, no-c-format
msgid "Web Beans makes it easy to obtain a dependent instance of a Java class or EJB bean, even if the class or EJB bean is already declared as a Web Bean with some other scope type."
-msgstr ""
+msgstr "Web Beans facilità l'ottenimento di un'istanza dipendente di una classe Java o bean EJB, anche se la classe o bean EJB sono già dichiarati come Web Bean con qualche altro tipo di scope."
#. Tag: title
#: scopescontexts.xml:248
#, no-c-format
msgid "The <literal>@New</literal> annotation"
-msgstr ""
+msgstr "Annotazione <literal>@New</literal>"
#. Tag: para
#: scopescontexts.xml:250
#, no-c-format
msgid "The built-in <literal>@New</literal> binding annotation allows <emphasis>implicit</emphasis> definition of a dependent Web Bean at an injection point. Suppose we declare the following injected field:"
-msgstr ""
+msgstr "L'annotazione predefinita di binding <literal>@New</literal> consente la definizione<emphasis>implicita</emphasis> di un Web Bean dipendente in un punti di iniezione. Si supponga di dichiarare il seguentecampo iniettato:"
#. Tag: programlisting
#: scopescontexts.xml:254
@@ -461,13 +461,13 @@
#: scopescontexts.xml:256
#, no-c-format
msgid "Then a Web Bean with scope <literal>@Dependent</literal>, binding type <literal>@New</literal>, API type <literal>Calculator</literal>, implementation class <literal>Calculator</literal> and deployment type <literal>@Standard</literal> is implicitly defined."
-msgstr ""
+msgstr "Allora viene implicitamente definito il Web Bean con scope <literal>@Dependent</literal>, tipo di binding <literal>@New</literal>, tipo di API <literal>Calculator</literal>, classe di implementazione <literal>Calculator</literal> e tipo di deploy <literal>@Standard</literal>."
#. Tag: para
#: scopescontexts.xml:261
#, no-c-format
msgid "This is true even if <literal>Calculator</literal> is <emphasis>already</emphasis> declared with a different scope type, for example:"
-msgstr ""
+msgstr "Questo è vero se <literal>Calculator</literal> è <emphasis>già</emphasis> dichiarato con un tipo di scope differente, per esempio:"
#. Tag: programlisting
#: scopescontexts.xml:264
@@ -483,7 +483,7 @@
#: scopescontexts.xml:266
#, no-c-format
msgid "So the following injected attributes each get a different instance of <literal>Calculator</literal>:"
-msgstr ""
+msgstr "Quindi i seguenti attributi iniettati ricevono ciascuno un'istanza di <literal>Calculator</literal>:"
#. Tag: programlisting
#: scopescontexts.xml:269
@@ -507,11 +507,11 @@
#: scopescontexts.xml:271
#, no-c-format
msgid "The <literal>calculator</literal> field has a conversation-scoped instance of <literal>Calculator</literal> injected. The <literal>newCalculator</literal> field has a new instance of <literal>Calculator</literal> injected, with a lifecycle that is bound to the owning <literal>PaymentCalc</literal>."
-msgstr ""
+msgstr "Il campo <literal>calculator</literal> ha iniettata un'istanza con scope conversazionale di <literal>Calculator</literal>. Il campo <literal>newCalculator</literal> ha iniettata un nuova istanza di <literal>Calculator</literal>, con ciclo di vita che è legato a <literal>PaymentCalc</literal>."
#. Tag: para
#: scopescontexts.xml:276
#, no-c-format
msgid "This feature is particularly useful with producer methods, as we'll see in the next chapter."
-msgstr ""
+msgstr "Questa caratteristica è particolarmente utile con i metodi produttori, come si vedrà nel prossimo capitolo."
16 years
[webbeans-commits] Webbeans SVN: r731 - doc/trunk/reference/it-IT/modules.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2008-12-25 16:18:03 -0500 (Thu, 25 Dec 2008)
New Revision: 731
Modified:
doc/trunk/reference/it-IT/modules/stereotypes.po
Log:
WBRI-69: Italian translation for Web Beans
Modified: doc/trunk/reference/it-IT/modules/stereotypes.po
===================================================================
--- doc/trunk/reference/it-IT/modules/stereotypes.po 2008-12-25 17:38:43 UTC (rev 730)
+++ doc/trunk/reference/it-IT/modules/stereotypes.po 2008-12-25 21:18:03 UTC (rev 731)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-12-19 20:26+0000\n"
-"PO-Revision-Date: 2008-12-25 12:05+0100\n"
+"PO-Revision-Date: 2008-12-25 22:17+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -207,7 +207,7 @@
#: stereotypes.xml:84
#, no-c-format
msgid "We can also force all Web Bean with a certain stereotype to implement an interface or extend a class:"
-msgstr "Si può forzare tutti i Web Bean con certi stereotipi ad implementare un'interfaccia o ad estendere una classe:"
+msgstr "Tutti i Web Bean con certi stereotipi possono venire forzati ad implementare un'interfaccia o ad estendere una classe:"
#. Tag: programlisting
#: stereotypes.xml:87
16 years
[webbeans-commits] Webbeans SVN: r730 - doc/trunk/reference.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2008-12-25 12:38:43 -0500 (Thu, 25 Dec 2008)
New Revision: 730
Modified:
doc/trunk/reference/pom.xml
Log:
Corrected chinese translation build
Modified: doc/trunk/reference/pom.xml
===================================================================
--- doc/trunk/reference/pom.xml 2008-12-25 15:05:59 UTC (rev 729)
+++ doc/trunk/reference/pom.xml 2008-12-25 17:38:43 UTC (rev 730)
@@ -66,7 +66,7 @@
<masterTranslation>en</masterTranslation>
<translations>
<translation>it-IT</translation>
- <translation>zh-ZH</translation>
+ <translation>zh-CN</translation>
</translations>
<imageResource>
<directory>${pom.basedir}/en</directory>
16 years
[webbeans-commits] Webbeans SVN: r729 - doc/trunk/reference/it-IT.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2008-12-25 10:05:59 -0500 (Thu, 25 Dec 2008)
New Revision: 729
Modified:
doc/trunk/reference/it-IT/master.po
Log:
WBRI-69: Italian translation for Web Beans
Modified: doc/trunk/reference/it-IT/master.po
===================================================================
--- doc/trunk/reference/it-IT/master.po 2008-12-25 15:05:32 UTC (rev 728)
+++ doc/trunk/reference/it-IT/master.po 2008-12-25 15:05:59 UTC (rev 729)
@@ -3,11 +3,11 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: master.xml \n"
+"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-12-19 20:29+0000\n"
-"PO-Revision-Date: 2008-12-19 20:26+0000\n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2008-12-25 15:28+0100\n"
+"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,22 +17,23 @@
#: master.xml:12
#, no-c-format
msgid "Using contextual objects"
-msgstr ""
+msgstr "Usare gli oggetti contestuali"
#. Tag: title
#: master.xml:25
#, no-c-format
msgid "Developing loosely-coupled code"
-msgstr ""
+msgstr "Sviluppare codice debolmente-accoppiato"
#. Tag: title
#: master.xml:35
#, no-c-format
msgid "Making the most of strong typing"
-msgstr ""
+msgstr "Realizzare una tipizzazione più forte"
#. Tag: title
#: master.xml:46
#, no-c-format
msgid "Web Beans and the Java EE ecosystem"
-msgstr ""
+msgstr "Web Beans e l'ecosistema Java EE"
+
16 years
[webbeans-commits] Webbeans SVN: r728 - doc/trunk/reference/it-IT/modules.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2008-12-25 10:05:32 -0500 (Thu, 25 Dec 2008)
New Revision: 728
Modified:
doc/trunk/reference/it-IT/modules/specialization.po
doc/trunk/reference/it-IT/modules/xml.po
Log:
WBRI-69: Italian translation for Web Beans
Modified: doc/trunk/reference/it-IT/modules/specialization.po
===================================================================
--- doc/trunk/reference/it-IT/modules/specialization.po 2008-12-25 15:05:06 UTC (rev 727)
+++ doc/trunk/reference/it-IT/modules/specialization.po 2008-12-25 15:05:32 UTC (rev 728)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-12-19 20:26+0000\n"
-"PO-Revision-Date: 2008-12-20 00:52+0100\n"
+"PO-Revision-Date: 2008-12-25 16:03+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -23,7 +23,7 @@
#: specialization.xml:6
#, no-c-format
msgid "We've already seen how the Web Beans dependency injection model lets us <emphasis>override</emphasis> the implementation of an API at deployment time. For example, the following enterprise Web Bean provides an implementation of the API <literal>PaymentProcessor</literal> in production:"
-msgstr ""
+msgstr "Si è già visto come il modello di dependency injection di Web Beans consenta l'<emphasis>override</emphasis> dell'implementazione di un API a deployment time. Per esempio, il seguente Web Bean enterprise fornisce un'implementazione di un API <literal>PaymentProcessor</literal> in produzione:"
#. Tag: programlisting
#: specialization.xml:11
@@ -45,7 +45,7 @@
#: specialization.xml:13
#, no-c-format
msgid "But in our staging environment, we override that implementation of <literal>PaymentProcessor</literal> with a different Web Bean:"
-msgstr ""
+msgstr "Ma in quest'ambiente di prova si procede con l'override dell'implementazione di <literal>PaymentProcessor</literal> con un Web Bean differente:"
#. Tag: programlisting
#: specialization.xml:16
@@ -67,7 +67,7 @@
#: specialization.xml:18
#, no-c-format
msgid "What we've tried to do with <literal>StagingCreditCardPaymentProcessor</literal> is to completely replace <literal>AsyncPaymentProcessor</literal> in a particular deployment of the system. In that deployment, the deployment type <literal>@Staging</literal> would have a higher priority than the default deployment type <literal>@Production</literal>, and therefore clients with the following injection point:"
-msgstr ""
+msgstr "Quello che si è cercato di fare con <literal>StagingCreditCardPaymentProcessor</literal> è sostituire completamente <literal>AsyncPaymentProcessor</literal> in un particolare deployment del sistema. In tale deployment, il tipo di deploy <literal>@Staging</literal> avrebbe più alta priorità del tipo di deploy di default <literal>@Production</literal>, e quindi client con il seguente punto di iniezione:"
#. Tag: programlisting
#: specialization.xml:24
@@ -79,7 +79,7 @@
#: specialization.xml:26
#, no-c-format
msgid "Would receive an instance of <literal>StagingCreditCardPaymentProcessor</literal>."
-msgstr ""
+msgstr "riceverebbero un'istanza di <literal>StagingCreditCardPaymentProcessor</literal>."
#. Tag: para
#: specialization.xml:28
@@ -91,37 +91,37 @@
#: specialization.xml:32
#, no-c-format
msgid "the higher-priority Web Bean may not implement all the API types of the Web Bean that it attempts to override,"
-msgstr ""
+msgstr "il Web Bean con più alta priorità potrebbe non implementare tutti i tipi di API del Web Bean di cui tenta di fare override,"
#. Tag: para
#: specialization.xml:36
#, no-c-format
msgid "the higher-priority Web Bean may not declare all the binding types of the Web Bean that it attempts to override,"
-msgstr ""
+msgstr "il Web Bean con più alta priorità potrebbe non dichiare tutti i tipi di binding del Web Bean di cui tenta di fare override,"
#. Tag: para
#: specialization.xml:40
#, no-c-format
msgid "the higher-priority Web Bean might not have the same name as the Web Bean that it attempts to override, or"
-msgstr ""
+msgstr "il Web Bean con più alta priorità potrebbe non avere lo stesso nome del Web Bean di cui tenta di fare override, oppure"
#. Tag: para
#: specialization.xml:44
#, no-c-format
msgid "the Web Bean that it attempts to override might declare a producer method, disposal method or observer method."
-msgstr ""
+msgstr "il Web Bean di cui tenta di fare override potrebbe dichiarare un metodo produttore, metodo distruttore o metodo osservatore."
#. Tag: para
#: specialization.xml:49
#, no-c-format
msgid "In each of these cases, the Web Bean that we tried to override could still be called at runtime. Therefore, overriding is somewhat prone to developer error."
-msgstr ""
+msgstr "In ciascuno di questi casi, il Web Bean di cui si tenta l'override potrebbe ancora venire chiamato a runtime. Quindi, l'override è qualcosa di incline all'errore per lo sviluppatore."
#. Tag: para
#: specialization.xml:52
#, no-c-format
msgid "Web Beans provides a special feature, called <emphasis>specialization</emphasis>, that helps the developer avoid these traps. Specialization looks a little esoteric at first, but it's easy to use in practice, and you'll really appreciate the extra security it provides."
-msgstr ""
+msgstr "Web Beans fornisce una funzionalità speciale chiamata <emphasis>specializzazione</emphasis>, che aiuta lo sviluppatore ad evitare queste trappole. La specializzazione sembra inizialmente un pò esoterica, ma in pratica è facile da usare, e si apprezzerà veramente la sicurezza extra che fornisce. "
#. Tag: title
#: specialization.xml:58
@@ -133,7 +133,7 @@
#: specialization.xml:60
#, no-c-format
msgid "Specialization is a feature that is specific to simple and enterprise Web Beans. To make use of specialization, the higher-priority Web Bean must:"
-msgstr ""
+msgstr "La specializzazione è una funzionalità specifica dei Web Bean semplici ed enterprise. Per fare uso della specializzazione il Web Bean a più alta priorità deve:"
#. Tag: para
#: specialization.xml:65
@@ -173,7 +173,7 @@
#: specialization.xml:79
#, no-c-format
msgid "We say that the higher-priority Web Bean <emphasis>specializes</emphasis> its superclass."
-msgstr ""
+msgstr "Si dice che il Web Bean a più alta priorità <emphasis>specializza</emphasis> la sua superclasse."
#. Tag: title
#: specialization.xml:85
@@ -191,59 +191,59 @@
#: specialization.xml:91
#, no-c-format
msgid "the binding types of the superclass are automatically inherited by the Web Bean annotated <literal>@Specializes</literal>, and"
-msgstr ""
+msgstr "i tipi di binding della superclasse vengono automaticamente ereditati dal Web Bean annotato con <literal>@Specializes</literal>, e"
#. Tag: para
#: specialization.xml:95
#, no-c-format
msgid "the Web Bean name of the superclass is automatically inherited by the Web Bean annotated <literal>@Specializes</literal>, and"
-msgstr ""
+msgstr "il nome del Web Bean della superclasse è automaticamente ereditato dal Web Bean annotato con <literal>@Specializes</literal>, e"
#. Tag: para
#: specialization.xml:99
#, no-c-format
msgid "producer methods, disposal methods and observer methods declared by the superclass are called upon an instance of the Web Bean annotated <literal>@Specializes</literal>."
-msgstr ""
+msgstr "i metodi produttori, metodi distruttori e metodi osservatori dichiarati dalla superclasse vengono chiamati da un'istanza del Web Bean annotato con <literal>@Specializes</literal>."
#. Tag: para
#: specialization.xml:105
#, no-c-format
msgid "In our example, the binding type <literal>@CreditCard</literal> of <literal>CreditCardPaymentProcessor</literal> is inherited by <literal>StagingCreditCardPaymentProcessor</literal>."
-msgstr ""
+msgstr "Nel nostro esempio, il tipo di binding <literal>@CreditCard</literal> di <literal>CreditCardPaymentProcessor</literal> viene ereditato da <literal>StagingCreditCardPaymentProcessor</literal>."
#. Tag: para
#: specialization.xml:109
#, no-c-format
msgid "Furthermore, the Web Bean manager will validate that:"
-msgstr ""
+msgstr "Inoltre il manager Web Bean validerà che:"
#. Tag: para
#: specialization.xml:113
#, no-c-format
msgid "all API types of the superclass are API types of the Web Bean annotated <literal>@Specializes</literal> (all local interfaces of the superclass enterprise bean are also local interfaces of the subclass),"
-msgstr ""
+msgstr "tutti i tipi di API della superclasse sono tipi di API del Web Bean annotato con <literal>@Specializes</literal> (tutte le interfacce locali del bean enterprise della superclasse sono anch'essi interfacce della sottoclasse),"
#. Tag: para
#: specialization.xml:119
#, no-c-format
msgid "the deployment type of the Web Bean annotated <literal>@Specializes</literal> has a higher precedence than the deployment type of the superclass, and"
-msgstr ""
+msgstr "il tipo di deploy di un Web Bean annotato con <literal>@Specializes</literal> ha una precedenza più alta di un tipo di deploy della superclasse, e"
#. Tag: para
#: specialization.xml:124
#, no-c-format
msgid "there is no other enabled Web Bean that also specializes the superclass."
-msgstr ""
+msgstr "non esiste nessun altro Web Bean che specializza la superclasse."
#. Tag: para
#: specialization.xml:129
#, no-c-format
msgid "If any of these conditions are violated, the Web Bean manager throws an exception at initialization time."
-msgstr ""
+msgstr "Se una di queste condizioni viene violata, il manager Web Bean lancia un'eccezione in fase di inizializzazione."
#. Tag: para
#: specialization.xml:132
#, no-c-format
msgid "Therefore, we can be certain that the superclass with <emphasis>never</emphasis> be called in any deployment of the system where the Web Bean annotated <literal>@Specializes</literal> is deployed and enabled."
-msgstr ""
+msgstr "Quindi, si può essere certi che la superclasse non verrà <emphasis>mai</emphasis> chiamata in alcun deploy del sistema in cui viene deployato ed abilitato il Web Bean annotato con <literal>@Specializes</literal>."
Modified: doc/trunk/reference/it-IT/modules/xml.po
===================================================================
--- doc/trunk/reference/it-IT/modules/xml.po 2008-12-25 15:05:06 UTC (rev 727)
+++ doc/trunk/reference/it-IT/modules/xml.po 2008-12-25 15:05:32 UTC (rev 728)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-12-19 20:26+0000\n"
-"PO-Revision-Date: 2008-12-21 09:46+0100\n"
+"PO-Revision-Date: 2008-12-25 15:29+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -23,7 +23,7 @@
#: xml.xml:6
#, no-c-format
msgid "So far, we've seen plenty of examples of Web Beans declared using annotations. However, there are a couple of occasions when we can't use annotations to define the Web Bean:"
-msgstr "Finora abbiamo visto molti esempi di Web Bean dichiarati usando annotazioni. Comunque ci sono varie occasioni in cui non è possibile usare le annotazioni per definire un Web Bean:"
+msgstr "Finora si sono visti molti esempi di Web Bean dichiarati usando annotazioni. Comunque ci sono varie occasioni in cui non è possibile usare le annotazioni per definire un Web Bean:"
#. Tag: para
#: xml.xml:12
@@ -131,7 +131,7 @@
#: xml.xml:69
#, no-c-format
msgid "We can declare the scope, deployment type and interceptor binding types using direct child elements of the Web Bean declaration:"
-msgstr "Possiamo dichiarare lo scope, il tipo di deploy ed i tipi di binding degli interceptor usando elementi figli diretti della dichiarazione Web Bean:"
+msgstr "E' possibile dichiarare lo scope, il tipo di deploy ed i tipi di binding degli interceptor usando elementi figli diretti della dichiarazione Web Bean:"
#. Tag: programlisting
#: xml.xml:72
@@ -153,7 +153,7 @@
#: xml.xml:74
#, no-c-format
msgid "We use exactly the same approach to specify names and binding type:"
-msgstr "Utilizziamo esattamente lo stesso approccio per specificare i nomi ed il tipo di binding:"
+msgstr "Si utilizza esattamente lo stesso approccio per specificare i nomi ed il tipo di binding:"
#. Tag: programlisting
#: xml.xml:76
16 years