Skip to content

Commit

Permalink
move Manager to own package, add cleanup for method handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuir committed Jan 8, 2010
1 parent 846add6 commit 191254e
Show file tree
Hide file tree
Showing 171 changed files with 403 additions and 333 deletions.
2 changes: 2 additions & 0 deletions impl/src/main/java/org/jboss/weld/Container.java
Expand Up @@ -27,8 +27,10 @@
import org.jboss.weld.bootstrap.api.Singleton;
import org.jboss.weld.bootstrap.api.SingletonProvider;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.exceptions.ForbiddenArgumentException;
import org.jboss.weld.logging.LoggerFactory;
import org.jboss.weld.logging.MessageConveyorFactory;
import org.jboss.weld.manager.BeanManagerImpl;

/**
* A Weld application container
Expand Down
51 changes: 0 additions & 51 deletions impl/src/main/java/org/jboss/weld/Logger.java

This file was deleted.

4 changes: 2 additions & 2 deletions impl/src/main/java/org/jboss/weld/bean/AbstractBean.java
Expand Up @@ -44,14 +44,14 @@
import javax.inject.Named;
import javax.inject.Qualifier;

import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
import org.jboss.weld.DefinitionException;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.injection.WeldInjectionPoint;
import org.jboss.weld.introspector.WeldAnnotated;
import org.jboss.weld.literal.AnyLiteral;
import org.jboss.weld.literal.DefaultLiteral;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.metadata.cache.MergedStereotypes;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.util.Beans;
Expand Down
14 changes: 6 additions & 8 deletions impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
Expand Up @@ -36,8 +36,6 @@
import java.util.List;
import java.util.Set;

import javassist.util.proxy.ProxyObject;

import javax.enterprise.context.Dependent;
import javax.enterprise.context.NormalScope;
import javax.enterprise.context.spi.CreationalContext;
Expand All @@ -56,21 +54,21 @@
import org.jboss.interceptor.model.InterceptorClassMetadataImpl;
import org.jboss.interceptor.util.InterceptionUtils;
import org.jboss.interceptor.util.proxy.TargetInstanceProxy;
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.DefinitionException;
import org.jboss.weld.DeploymentException;
import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.WeldException;
import org.jboss.weld.bean.proxy.DecoratorProxyMethodHandler;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.context.SerializableContextualImpl;
import org.jboss.weld.context.SerializableContextualInstanceImpl;
import org.jboss.weld.ejb.EJBApiAbstraction;
import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.exceptions.DeploymentException;
import org.jboss.weld.exceptions.ForbiddenStateException;
import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.injection.ConstructorInjectionPoint;
import org.jboss.weld.injection.FieldInjectionPoint;
import org.jboss.weld.injection.MethodInjectionPoint;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
import org.jboss.weld.serialization.spi.helpers.SerializableContextualInstance;
Expand Down Expand Up @@ -235,7 +233,7 @@ protected T applyDecorators(T instance, CreationalContext<T> creationalContext,
// temporary fix for decorators - make sure that the instance wrapped by the decorators
// is the contextual instance
// TODO - correct the decoration algorithm to avoid the creation of new target class instances
((ProxyObject) proxy).setHandler(new DecoratorProxyMethodHandler(decoratorInstances, decoratedActualInstance.get()));
Proxies.attachMethodHandler(proxy, new DecoratorProxyMethodHandler(decoratorInstances, decoratedActualInstance.get()));
return proxy;
}
catch (InstantiationException e)
Expand Down
Expand Up @@ -53,13 +53,13 @@
import javax.inject.Inject;
import javax.inject.Scope;

import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
import org.jboss.weld.DefinitionException;
import org.jboss.weld.IllegalProductException;
import org.jboss.weld.WeldException;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.exceptions.IllegalProductException;
import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.introspector.WeldMember;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.Names;
Expand Down
Expand Up @@ -25,10 +25,10 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.Alternative;

import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.context.WeldCreationalContext;
import org.jboss.weld.introspector.WeldMember;
import org.jboss.weld.manager.BeanManagerImpl;
import org.slf4j.cal10n.LocLogger;

/**
Expand Down
Expand Up @@ -19,9 +19,9 @@

import javax.enterprise.inject.spi.Decorator;

import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.introspector.MethodSignature;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.util.Deployers;

Expand Down
9 changes: 3 additions & 6 deletions impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java
Expand Up @@ -33,17 +33,14 @@
import java.util.HashSet;
import java.util.Set;

import javassist.util.proxy.ProxyObject;

import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.Decorator;
import javax.inject.Inject;

import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.DefinitionException;
import org.jboss.weld.bean.proxy.AbstractDecoratorMethodHandler;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.injection.MethodInjectionPoint;
import org.jboss.weld.injection.ProxyClassConstructorInjectionPointWrapper;
import org.jboss.weld.injection.WeldInjectionPoint;
Expand All @@ -53,6 +50,7 @@
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.jlr.WeldClassImpl;
import org.jboss.weld.introspector.jlr.WeldConstructorImpl;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.util.Deployers;
import org.jboss.weld.util.Proxies;
Expand Down Expand Up @@ -293,8 +291,7 @@ protected T createInstance(CreationalContext<T> ctx)
{
ProxyClassConstructorInjectionPointWrapper<T> constructorInjectionPointWrapper = new ProxyClassConstructorInjectionPointWrapper(this, constructorForAbstractDecorator, getConstructor());
T instance = constructorInjectionPointWrapper.newInstance(manager, ctx);
AbstractDecoratorMethodHandler abstractDecoratorMethodHandler = new AbstractDecoratorMethodHandler(annotatedDelegateItem, getDelegateInjectionPoint(), constructorInjectionPointWrapper.getInjectedDelegate());
((ProxyObject)instance).setHandler(abstractDecoratorMethodHandler);
Proxies.attachMethodHandler(instance, new AbstractDecoratorMethodHandler(annotatedDelegateItem, getDelegateInjectionPoint(), constructorInjectionPointWrapper.getInjectedDelegate()));
return instance;
}
}
Expand Down
4 changes: 2 additions & 2 deletions impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java
Expand Up @@ -34,12 +34,12 @@
import javax.enterprise.inject.Produces;
import javax.inject.Inject;

import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.DefinitionException;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.injection.MethodInjectionPoint;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.WeldParameter;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.reflection.SecureReflections;

Expand Down
6 changes: 3 additions & 3 deletions impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java
Expand Up @@ -31,10 +31,10 @@
import org.jboss.interceptor.model.InterceptorClassMetadata;
import org.jboss.interceptor.proxy.DirectClassInterceptionHandler;
import org.jboss.interceptor.registry.InterceptorClassMetadataRegistry;
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.DeploymentException;
import org.jboss.weld.WeldException;
import org.jboss.weld.exceptions.DeploymentException;
import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Beans;

/**
Expand Down
8 changes: 4 additions & 4 deletions impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
Expand Up @@ -45,19 +45,19 @@
import org.jboss.interceptor.proxy.InterceptorProxyCreatorImpl;
import org.jboss.interceptor.registry.InterceptorRegistry;
import org.jboss.interceptor.util.InterceptionUtils;
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
import org.jboss.weld.DefinitionException;
import org.jboss.weld.DeploymentException;
import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.bean.interceptor.CdiInterceptorHandlerFactory;
import org.jboss.weld.bean.interceptor.ClassInterceptionHandlerFactory;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.exceptions.DeploymentException;
import org.jboss.weld.exceptions.ForbiddenStateException;
import org.jboss.weld.injection.InjectionContextImpl;
import org.jboss.weld.injection.WeldInjectionPoint;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldField;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
import org.jboss.weld.util.Beans;
Expand Down
2 changes: 1 addition & 1 deletion impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java
Expand Up @@ -22,9 +22,9 @@

import javax.enterprise.context.Dependent;

import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.literal.NewLiteral;
import org.jboss.weld.manager.BeanManagerImpl;

/**
* Represents a @New simple bean
Expand Down
2 changes: 1 addition & 1 deletion impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java
Expand Up @@ -22,10 +22,10 @@

import javax.enterprise.context.Dependent;

import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.ejb.InternalEjbDescriptor;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.literal.NewLiteral;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resources.ClassTransformer;

/**
Expand Down
2 changes: 1 addition & 1 deletion impl/src/main/java/org/jboss/weld/bean/ProducerField.java
Expand Up @@ -26,9 +26,9 @@
import javax.enterprise.inject.spi.Producer;

import org.jboss.interceptor.util.InterceptionUtils;
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.introspector.WeldField;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Names;

/**
Expand Down
6 changes: 3 additions & 3 deletions impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
Expand Up @@ -34,14 +34,14 @@
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.Producer;

import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.DefinitionException;
import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.exceptions.ForbiddenStateException;
import org.jboss.weld.injection.MethodInjectionPoint;
import org.jboss.weld.injection.ParameterInjectionPoint;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.WeldParameter;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Names;
import org.jboss.weld.util.reflection.SecureReflections;

Expand Down
2 changes: 1 addition & 1 deletion impl/src/main/java/org/jboss/weld/bean/RIBean.java
Expand Up @@ -23,9 +23,9 @@
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.PassivationCapable;

import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.injection.WeldInjectionPoint;
import org.jboss.weld.manager.BeanManagerImpl;

/**
* Abstract base class with functions specific to RI built-in beans
Expand Down
12 changes: 6 additions & 6 deletions impl/src/main/java/org/jboss/weld/bean/SessionBean.java
Expand Up @@ -50,12 +50,6 @@
import javax.interceptor.Interceptor;

import org.jboss.interceptor.model.InterceptionModel;
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.CreationException;
import org.jboss.weld.DefinitionException;
import org.jboss.weld.ForbiddenArgumentException;
import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.WeldException;
import org.jboss.weld.bean.interceptor.InterceptorBindingsAdapter;
import org.jboss.weld.bean.proxy.EnterpriseBeanInstance;
import org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler;
Expand All @@ -65,9 +59,15 @@
import org.jboss.weld.ejb.api.SessionObjectReference;
import org.jboss.weld.ejb.spi.BusinessInterfaceDescriptor;
import org.jboss.weld.ejb.spi.EjbServices;
import org.jboss.weld.exceptions.CreationException;
import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.exceptions.ForbiddenArgumentException;
import org.jboss.weld.exceptions.ForbiddenStateException;
import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.injection.InjectionContextImpl;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
import org.jboss.weld.util.Beans;
Expand Down
Expand Up @@ -24,12 +24,12 @@

import javax.enterprise.context.Dependent;

import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.RIBean;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.injection.WeldInjectionPoint;
import org.jboss.weld.literal.AnyLiteral;
import org.jboss.weld.literal.DefaultLiteral;
import org.jboss.weld.manager.BeanManagerImpl;

public abstract class AbstractBuiltInBean<T> extends RIBean<T>
{
Expand Down
Expand Up @@ -26,8 +26,8 @@

import javax.enterprise.inject.spi.InjectionPoint;

import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.exceptions.ForbiddenStateException;
import org.jboss.weld.manager.BeanManagerImpl;

/**
* Common implementation for binding-type-based helpers
Expand Down
Expand Up @@ -23,7 +23,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.InjectionPoint;

import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.manager.BeanManagerImpl;
import org.slf4j.cal10n.LocLogger;

public abstract class AbstractFacadeBean<T> extends AbstractBuiltInBean<T>
Expand Down
Expand Up @@ -22,7 +22,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.BeanManager;

import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.collections.Arrays2;

public class BeanManagerBean extends AbstractBuiltInBean<BeanManagerImpl>
Expand Down

0 comments on commit 191254e

Please sign in to comment.