openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r732803 [5/17] - in /incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: ./ annotation/ component/ component/ejb/ component/jms/ component/xml/ config/ container/ context/ context/type/ decorator/ decorator/xml/ de...
Date Thu, 08 Jan 2009 19:41:33 GMT
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.context;
 
@@ -22,7 +19,6 @@
 
 import org.apache.webbeans.context.type.ContextTypes;
 
-
 /**
  * Conversation context implementation.
  * 
@@ -31,19 +27,19 @@
  */
 public class ConversationContext extends AbstractContext
 {
-	/*
-	 * Constructor
-	 */
-	protected ConversationContext()
-	{
-		super(ContextTypes.CONVERSATION);
-	}
-
-	@Override
-	public void setComponentInstanceMap()
-	{
-		this.componentInstanceMap = new ConcurrentHashMap<Bean<?>, Object>();
-		
-	}
+    /*
+     * Constructor
+     */
+    protected ConversationContext()
+    {
+        super(ContextTypes.CONVERSATION);
+    }
+
+    @Override
+    public void setComponentInstanceMap()
+    {
+        this.componentInstanceMap = new ConcurrentHashMap<Bean<?>, Object>();
+
+    }
 
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/DependentContext.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/DependentContext.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/DependentContext.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/DependentContext.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.context;
 
@@ -23,15 +20,13 @@
 import org.apache.webbeans.component.AbstractComponent;
 import org.apache.webbeans.context.type.ContextTypes;
 
-
 /**
  * Defines the component {@link Dependent} context.
- * 
  * <p>
- * Each web beans component has a dependent context, that saves its
- * depedent objects. Dependent context is destroyed at the end of the component
- * destruction or its dependent objects are destroyed by the container at any time
- * that the dependent object is no longer alive.
+ * Each web beans component has a dependent context, that saves its depedent
+ * objects. Dependent context is destroyed at the end of the component
+ * destruction or its dependent objects are destroyed by the container at any
+ * time that the dependent object is no longer alive.
  * </p>
  * 
  * @author <a href="mailto:gurkanerdogdu@yahoo.com">Gurkan Erdogdu</a>
@@ -39,61 +34,56 @@
  */
 public class DependentContext extends AbstractContext
 {
-	private AbstractComponent<?> owner;
-	
-	public DependentContext()
-	{
-		super(ContextTypes.DEPENDENT);
-		
-	}
-	
-	
-	@Override
-	protected <T> T getInstance(Bean<T> component, boolean create)
-	{
-		if(isActive())
-		{
-			if(create)
-			{
-				T object = component.create();
-
-				return object;
-			}			
-		}
-		
-		else
-		{
-			throw new ContextNotActiveException("Dependent  context with WebBeans component class : "+ owner.getReturnType() + " is not active");
-		}
-		
-		return null;
-	}
+    private AbstractComponent<?> owner;
 
+    public DependentContext()
+    {
+        super(ContextTypes.DEPENDENT);
+
+    }
+
+    @Override
+    protected <T> T getInstance(Bean<T> component, boolean create)
+    {
+        if (isActive())
+        {
+            if (create)
+            {
+                T object = component.create();
+
+                return object;
+            }
+        }
+
+        else
+        {
+            throw new ContextNotActiveException("Dependent  context with WebBeans component class : " + owner.getReturnType() + " is not active");
+        }
+
+        return null;
+    }
+
+    @Override
+    protected <T> void removeInstance(Bean<T> component)
+    {
+        // no-op
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.webbeans.context.AbstractContext#destroy()
+     */
+    @Override
+    public <T> void destroy()
+    {
+
+    }
+
+    @Override
+    public void setComponentInstanceMap()
+    {
 
+    }
 
-	@Override
-	protected <T> void removeInstance(Bean<T> component)
-	{
-		//no-op
-	}
-
-	
-
-	/* (non-Javadoc)
-	 * @see org.apache.webbeans.context.AbstractContext#destroy()
-	 */
-	@Override
-	public <T> void destroy()
-	{
-		
-	}
-
-
-	@Override
-	public void setComponentInstanceMap()
-	{
-		
-		
-	}
-	
 }
\ No newline at end of file

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/DependentContextReference.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/DependentContextReference.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/DependentContextReference.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/DependentContextReference.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.context;
 
@@ -21,48 +18,51 @@
 
 public class DependentContextReference extends WeakReference<Object>
 {
-	private Object object;
-	
-	public DependentContextReference(Object object, ReferenceQueue<Object> queue)
-	{
-		super(object, queue);
-		
-		this.object = object;
-	}
-
-	/* (non-Javadoc)
-	 * @see java.lang.Object#hashCode()
-	 */
-	@Override
-	public int hashCode()
-	{
-		final int prime = 31;
-		int result = 1;
-		result = prime * result + ((object == null) ? 0 : object.hashCode());
-		return result;
-	}
-
-	/* (non-Javadoc)
-	 * @see java.lang.Object#equals(java.lang.Object)
-	 */
-	@Override
-	public boolean equals(Object obj)
-	{
-		if (this == obj)
-			return true;
-		if (obj == null)
-			return false;
-		if (getClass() != obj.getClass())
-			return false;
-		final DependentContextReference other = (DependentContextReference) obj;
-		if (object == null)
-		{
-			if (other.object != null)
-				return false;
-		} else if (!object.equals(other.object))
-			return false;
-		return true;
-	}
-	
-	
+    private Object object;
+
+    public DependentContextReference(Object object, ReferenceQueue<Object> queue)
+    {
+        super(object, queue);
+
+        this.object = object;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((object == null) ? 0 : object.hashCode());
+        return result;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        final DependentContextReference other = (DependentContextReference) obj;
+        if (object == null)
+        {
+            if (other.object != null)
+                return false;
+        } else if (!object.equals(other.object))
+            return false;
+        return true;
+    }
+
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/RequestContext.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/RequestContext.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/RequestContext.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/RequestContext.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.context;
 
@@ -22,7 +19,6 @@
 
 import org.apache.webbeans.context.type.ContextTypes;
 
-
 /**
  * Request context implementation.
  * 
@@ -31,19 +27,19 @@
  */
 public class RequestContext extends AbstractContext
 {
-	/*
-	 * Constructor
-	 */
-	protected RequestContext()
-	{
-		super(ContextTypes.REQUEST);
-	}
-
-	@Override
-	public void setComponentInstanceMap()
-	{
-		this.componentInstanceMap = new HashMap<Bean<?>, Object>();
-		
-	}
+    /*
+     * Constructor
+     */
+    protected RequestContext()
+    {
+        super(ContextTypes.REQUEST);
+    }
+
+    @Override
+    public void setComponentInstanceMap()
+    {
+        this.componentInstanceMap = new HashMap<Bean<?>, Object>();
+
+    }
 
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContext.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContext.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContext.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContext.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.context;
 
@@ -22,7 +19,6 @@
 
 import org.apache.webbeans.context.type.ContextTypes;
 
-
 /**
  * Session context implementation.
  * 
@@ -31,16 +27,16 @@
  */
 public class SessionContext extends AbstractContext
 {
-	protected SessionContext()
-	{
-		super(ContextTypes.SESSION);
-	}
-
-	@Override
-	public void setComponentInstanceMap()
-	{
-		this.componentInstanceMap = new ConcurrentHashMap<Bean<?>, Object>();
-		
-	}
+    protected SessionContext()
+    {
+        super(ContextTypes.SESSION);
+    }
+
+    @Override
+    public void setComponentInstanceMap()
+    {
+        this.componentInstanceMap = new ConcurrentHashMap<Bean<?>, Object>();
+
+    }
 
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContextManager.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContextManager.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContextManager.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/SessionContextManager.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.context;
 
@@ -25,58 +22,58 @@
 
 public final class SessionContextManager
 {
-	private static SessionContextManager sessionContextManager = null;
-	
-	private Map<String, SessionContext> sessionContexts = null;
-
-	private SessionContextManager()
-	{
-		
-	}
-	
-	public static SessionContextManager getInstance()
-	{
-		if(sessionContextManager == null)
-		{
-			sessionContextManager = new SessionContextManager();
-			sessionContextManager.sessionContexts = new ConcurrentHashMap<String, SessionContext>();
-		}
-		
-		return sessionContextManager;
-	}
-	
-	public void addNewSessionContext(String sessionId, SessionContext context)
-	{
-		Asserts.assertNotNull(sessionId, "sessionId parameter can not be null");
-		Asserts.assertNotNull(context, "context parameter can not be null");
-		
-		sessionContexts.put(sessionId, context);
-	}
-	
-	public SessionContext getSessionContextWithSessionId(String sessionId)
-	{
-		Asserts.assertNotNull(sessionId, "sessionId parameter can not be null");
-		
-		return sessionContexts.get(sessionId);
-	}
-	
-	public void destroySessionContextWithSessionId(String sessionId)
-	{
-		Set<String> keySet = sessionContexts.keySet();
-		Iterator<String> it = keySet.iterator();
-		
-		while(it.hasNext())
-		{
-			String id = it.next();
-			if(id.equals(sessionId))
-			{
-				it.remove();
-			}
-		}
-	}
-	
-	public void destroyAllSessions()
-	{
-		sessionContexts.clear();
-	}
+    private static SessionContextManager sessionContextManager = null;
+
+    private Map<String, SessionContext> sessionContexts = null;
+
+    private SessionContextManager()
+    {
+
+    }
+
+    public static SessionContextManager getInstance()
+    {
+        if (sessionContextManager == null)
+        {
+            sessionContextManager = new SessionContextManager();
+            sessionContextManager.sessionContexts = new ConcurrentHashMap<String, SessionContext>();
+        }
+
+        return sessionContextManager;
+    }
+
+    public void addNewSessionContext(String sessionId, SessionContext context)
+    {
+        Asserts.assertNotNull(sessionId, "sessionId parameter can not be null");
+        Asserts.assertNotNull(context, "context parameter can not be null");
+
+        sessionContexts.put(sessionId, context);
+    }
+
+    public SessionContext getSessionContextWithSessionId(String sessionId)
+    {
+        Asserts.assertNotNull(sessionId, "sessionId parameter can not be null");
+
+        return sessionContexts.get(sessionId);
+    }
+
+    public void destroySessionContextWithSessionId(String sessionId)
+    {
+        Set<String> keySet = sessionContexts.keySet();
+        Iterator<String> it = keySet.iterator();
+
+        while (it.hasNext())
+        {
+            String id = it.next();
+            if (id.equals(sessionId))
+            {
+                it.remove();
+            }
+        }
+    }
+
+    public void destroyAllSessions()
+    {
+        sessionContexts.clear();
+    }
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/WebBeansContext.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/WebBeansContext.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/WebBeansContext.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/WebBeansContext.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.context;
 
@@ -23,29 +20,29 @@
  * backward capability with EDR-1 of the specification.
  * 
  * @author <a href="mailto:gurkanerdogdu@yahoo.com">Gurkan Erdogdu</a>
- * @since 1.0 
+ * @since 1.0
  */
 public interface WebBeansContext extends javax.webbeans.manager.Context
 {
-	/**
-	 * Gets the web beans component from the context. 
-	 * <p>
-	 * If the create argument is true and the instance is not contained
-	 * in the context, new instance is created and returned.
-	 * </p>
-	 * 
-	 * @param <T> generic type
-	 * @param component web beans component
-	 * @param create create or not flag
-	 * @return the web beans component instance
-	 */
-	public <T> T get(Bean<T> component, boolean create);
+    /**
+     * Gets the web beans component from the context.
+     * <p>
+     * If the create argument is true and the instance is not contained in the
+     * context, new instance is created and returned.
+     * </p>
+     * 
+     * @param <T> generic type
+     * @param component web beans component
+     * @param create create or not flag
+     * @return the web beans component instance
+     */
+    public <T> T get(Bean<T> component, boolean create);
 
-	/**
-	 * Removes the given web beans component from the context.
-	 * 
-	 * @param <T> generic type
-	 * @param component web beans component
-	 */
-	public <T> void remove(Bean<T> component);
+    /**
+     * Removes the given web beans component from the context.
+     * 
+     * @param <T> generic type
+     * @param component web beans component
+     */
+    public <T> void remove(Bean<T> component);
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/type/ContextTypes.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/type/ContextTypes.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/type/ContextTypes.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/type/ContextTypes.java Thu Jan  8 11:41:30 2009
@@ -1,27 +1,23 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.context.type;
 
 import javax.webbeans.manager.Context;
 
 /**
- * Defines the enumaration of the standart context types in the
- * web beans container.
- * 
+ * Defines the enumaration of the standart context types in the web beans
+ * container.
  * <p>
  * Standart context types,
  * <ul>
@@ -38,49 +34,42 @@
  */
 public enum ContextTypes
 {
-	REQUEST(0),
-	SESSION(1),
-	APPLICATION(2),
-	CONVERSATION(3),
-	DEPENDENT(4);
-	
-	int name;
-	
-	ContextTypes(int name)
-	{
-		this.name = name;
-	}
-	
-	public int getName()
-	{
-		return name;
-	}
-
-	public String getTypeName()
-	{
-		switch (getName())
-		{
-		case 0:
-			return "request";
-			
-		case 1:
-			return "session";
-
-		case 2:
-			return "application";
-
-		case 3:
-			return "conversation";
-			
-		case 4:
-			return "dependent";
-
-			
-
-		}
-		
-		return null;
-	}
+    REQUEST(0), SESSION(1), APPLICATION(2), CONVERSATION(3), DEPENDENT(4);
+
+    int name;
+
+    ContextTypes(int name)
+    {
+        this.name = name;
+    }
+
+    public int getName()
+    {
+        return name;
+    }
+
+    public String getTypeName()
+    {
+        switch (getName())
+        {
+        case 0:
+            return "request";
+
+        case 1:
+            return "session";
+
+        case 2:
+            return "application";
+
+        case 3:
+            return "conversation";
+
+        case 4:
+            return "dependent";
+
+        }
+
+        return null;
+    }
 
-	
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorComparator.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.decorator;
 
@@ -23,25 +20,22 @@
 public class DecoratorComparator implements Comparator<Decorator>
 {
 
-	public int compare(Decorator o1, Decorator o2)
-	{
-		WebBeansDecorator src = (WebBeansDecorator) o1;
-		WebBeansDecorator target = (WebBeansDecorator)o2;
-		
-		
-		if(o1.equals(o2))
-		{
-			return 0;
-		}
-		else
-		{
-			Class<?> o1Clazz = src.getClazz();
-			Class<?> o2Clazz = target.getClazz();
-			
-			return DecoratorsManager.getInstance().compare(o1Clazz, o2Clazz);
-			
-		}
-	}
-	
+    public int compare(Decorator o1, Decorator o2)
+    {
+        WebBeansDecorator src = (WebBeansDecorator) o1;
+        WebBeansDecorator target = (WebBeansDecorator) o2;
+
+        if (o1.equals(o2))
+        {
+            return 0;
+        } else
+        {
+            Class<?> o1Clazz = src.getClazz();
+            Class<?> o2Clazz = target.getClazz();
+
+            return DecoratorsManager.getInstance().compare(o1Clazz, o2Clazz);
+
+        }
+    }
 
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.decorator;
 
@@ -36,107 +33,103 @@
 import org.apache.webbeans.util.Asserts;
 import org.apache.webbeans.util.ClassUtil;
 
-public  final class DecoratorUtil
+public final class DecoratorUtil
 {
-	private static WebBeansLogger logger = WebBeansLogger.getLogger(DecoratorUtil.class);
-	
-	private DecoratorUtil()
-	{
-		
-	}
-	
-	public static void checkDecoratorConditions(Class<?> decoratorClazz)
-	{
-		Field[] fields = decoratorClazz.getDeclaredFields();
-		Set<Class<?>> decoratorSet = new HashSet<Class<?>>();
-		ClassUtil.setInterfaceTypeHierarchy(decoratorSet, decoratorClazz);
-		boolean found = false;
-		for(Field field : fields)
-		{
-			if(AnnotationUtil.isAnnotationExist(field.getAnnotations(), Decorates.class))
-			{
-				if(found)
-				{
-					throw new WebBeansConfigurationException("Decorator class : " + decoratorClazz.getName() + " can only contain one delegate attribute but find more than one!.");
-				}
-				else
-				{
-					Class<?> fieldType = field.getType();
-					if(!ClassUtil.isInterface(fieldType.getModifiers()))
-					{
-						throw new WebBeansConfigurationException("Decorator class : " + decoratorClazz.getName() + " delegate attribute type must be interface"); 
-					}
-					
-					for(Class<?> decType : decoratorSet)
-					{
-						if(!fieldType.isAssignableFrom(decType))
-						{
-							throw new WebBeansConfigurationException("Decorator class : " + decoratorClazz.getName() + " delegate attribute must implement all of the decorator decorated types.");
-						}
-					}					
-					
-					found = true;
-				}				
-			}
-			
-		}
-	}
-	
-	
-	public static void checkSimpleWebBeanDecoratorConditions(ComponentImpl<?> component)
-	{
-		Asserts.assertNotNull("component", "component parameter can not be null");
-		
-		Set<Annotation> annSet = component.getBindingTypes();
-		Annotation[] anns = new Annotation[annSet.size()];
-		anns = annSet.toArray(anns);
-		
-		List<Decorator> decoratorList = ManagerImpl.getManager().resolveDecorators(component.getTypes(), anns);
-		if(!decoratorList.isEmpty())
-		{
-			Class<?> clazz = component.getReturnType();
-			if(ClassUtil.isFinal(clazz.getModifiers()))
-			{
-				throw new WebBeansConfigurationException("Simple web bean component : " + component.getReturnType().getName() + 
-						" can not be declared final, because it has one or more decorators");
-			}
-			
-			Method[] methods = clazz.getDeclaredMethods();
-			for(Method method : methods)
-			{
-				int modifiers = method.getModifiers();
-				if(!ClassUtil.isStatic(modifiers) && !ClassUtil.isPrivate(modifiers) && ClassUtil.isFinal(modifiers))
-				{
-					//Check decorator implements this
-					Iterator<Decorator> itDecorator = decoratorList.iterator();
-					while(itDecorator.hasNext())
-					{
-						WebBeansDecorator decorator = (WebBeansDecorator)itDecorator.next();
-						Class<?> decClazz = decorator.getClazz();
-						
-						try
-						{
-							if(decClazz.getMethod(method.getName(),method.getParameterTypes()) != null)
-							{
-								throw new WebBeansConfigurationException("Simple web bean component : " + component.getReturnType().getName() + 
-								" can not define non-private, non-static, final method : "+ method.getName() + ", because one of its decorators implements this method");
-								
-							}
-							
-						} catch (SecurityException e)
-						{
-							logger.error("Security exception, can not access decorator class : " + decClazz.getName() + " method : " + method.getName(), e);
-							throw new WebBeansException(e);
-							
-						} catch (NoSuchMethodException e)
-						{
-							continue;
-						}
-						
-					}
-				}
-			}
-		}
-	}
-	
+    private static WebBeansLogger logger = WebBeansLogger.getLogger(DecoratorUtil.class);
+
+    private DecoratorUtil()
+    {
+
+    }
+
+    public static void checkDecoratorConditions(Class<?> decoratorClazz)
+    {
+        Field[] fields = decoratorClazz.getDeclaredFields();
+        Set<Class<?>> decoratorSet = new HashSet<Class<?>>();
+        ClassUtil.setInterfaceTypeHierarchy(decoratorSet, decoratorClazz);
+        boolean found = false;
+        for (Field field : fields)
+        {
+            if (AnnotationUtil.isAnnotationExist(field.getAnnotations(), Decorates.class))
+            {
+                if (found)
+                {
+                    throw new WebBeansConfigurationException("Decorator class : " + decoratorClazz.getName() + " can only contain one delegate attribute but find more than one!.");
+                } else
+                {
+                    Class<?> fieldType = field.getType();
+                    if (!ClassUtil.isInterface(fieldType.getModifiers()))
+                    {
+                        throw new WebBeansConfigurationException("Decorator class : " + decoratorClazz.getName() + " delegate attribute type must be interface");
+                    }
+
+                    for (Class<?> decType : decoratorSet)
+                    {
+                        if (!fieldType.isAssignableFrom(decType))
+                        {
+                            throw new WebBeansConfigurationException("Decorator class : " + decoratorClazz.getName() + " delegate attribute must implement all of the decorator decorated types.");
+                        }
+                    }
+
+                    found = true;
+                }
+            }
+
+        }
+    }
+
+    public static void checkSimpleWebBeanDecoratorConditions(ComponentImpl<?> component)
+    {
+        Asserts.assertNotNull("component", "component parameter can not be null");
+
+        Set<Annotation> annSet = component.getBindingTypes();
+        Annotation[] anns = new Annotation[annSet.size()];
+        anns = annSet.toArray(anns);
+
+        List<Decorator> decoratorList = ManagerImpl.getManager().resolveDecorators(component.getTypes(), anns);
+        if (!decoratorList.isEmpty())
+        {
+            Class<?> clazz = component.getReturnType();
+            if (ClassUtil.isFinal(clazz.getModifiers()))
+            {
+                throw new WebBeansConfigurationException("Simple web bean component : " + component.getReturnType().getName() + " can not be declared final, because it has one or more decorators");
+            }
+
+            Method[] methods = clazz.getDeclaredMethods();
+            for (Method method : methods)
+            {
+                int modifiers = method.getModifiers();
+                if (!ClassUtil.isStatic(modifiers) && !ClassUtil.isPrivate(modifiers) && ClassUtil.isFinal(modifiers))
+                {
+                    // Check decorator implements this
+                    Iterator<Decorator> itDecorator = decoratorList.iterator();
+                    while (itDecorator.hasNext())
+                    {
+                        WebBeansDecorator decorator = (WebBeansDecorator) itDecorator.next();
+                        Class<?> decClazz = decorator.getClazz();
+
+                        try
+                        {
+                            if (decClazz.getMethod(method.getName(), method.getParameterTypes()) != null)
+                            {
+                                throw new WebBeansConfigurationException("Simple web bean component : " + component.getReturnType().getName() + " can not define non-private, non-static, final method : " + method.getName() + ", because one of its decorators implements this method");
+
+                            }
+
+                        } catch (SecurityException e)
+                        {
+                            logger.error("Security exception, can not access decorator class : " + decClazz.getName() + " method : " + method.getName(), e);
+                            throw new WebBeansException(e);
+
+                        } catch (NoSuchMethodException e)
+                        {
+                            continue;
+                        }
+
+                    }
+                }
+            }
+        }
+    }
+
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.decorator;
 
@@ -24,56 +21,55 @@
 
 public class DecoratorsManager
 {
-	private List<Class<?>> enabledDecorators = new CopyOnWriteArrayList<Class<?>>();
-	
-	public DecoratorsManager()
-	{
-
-	}
-
-	public static  DecoratorsManager getInstance()
-	{
-		DecoratorsManager instance = (DecoratorsManager)WebBeansFinder.getSingletonInstance(WebBeansFinder.SINGLETON_DECORATORS_MANAGER);
-		
-		return instance;
-	}
-
-	public void addNewDecorator(Class<?> decoratorClazz)
-	{
-		Asserts.assertNotNull(decoratorClazz, "decoratorClazz parameter can not be emtpy");
-		if (!enabledDecorators.contains(decoratorClazz))
-		{
-			enabledDecorators.add(decoratorClazz);
-		}
-	}
-
-	public int compare(Class<?> src, Class<?> target)
-	{
-		Asserts.assertNotNull(src, "src parameter can not be  null");
-		Asserts.assertNotNull(target, "target parameter can not be null");
-
-		int srcIndex = enabledDecorators.indexOf(src);
-		int targetIndex = enabledDecorators.indexOf(target);
-
-		if (srcIndex == -1 || targetIndex == -1)
-		{
-			throw new IllegalArgumentException("One of the compare class of the list : [" + src.getName() + "," + target.getName() + "]" + " is not contained in the enabled decorators list!");
-		}
-
-		if (srcIndex == targetIndex)
-			return 0;
-		else if (srcIndex < targetIndex)
-			return -1;
-		else
-			return 1;
-	}
-	
-	public boolean isDecoratorEnabled(Class<?> decoratorClazz)
-	{
-		Asserts.nullCheckForClass(decoratorClazz, "decoratorClazz can not be null");
-
-		return enabledDecorators.contains(decoratorClazz);
-	}
-	
+    private List<Class<?>> enabledDecorators = new CopyOnWriteArrayList<Class<?>>();
+
+    public DecoratorsManager()
+    {
+
+    }
+
+    public static DecoratorsManager getInstance()
+    {
+        DecoratorsManager instance = (DecoratorsManager) WebBeansFinder.getSingletonInstance(WebBeansFinder.SINGLETON_DECORATORS_MANAGER);
+
+        return instance;
+    }
+
+    public void addNewDecorator(Class<?> decoratorClazz)
+    {
+        Asserts.assertNotNull(decoratorClazz, "decoratorClazz parameter can not be emtpy");
+        if (!enabledDecorators.contains(decoratorClazz))
+        {
+            enabledDecorators.add(decoratorClazz);
+        }
+    }
+
+    public int compare(Class<?> src, Class<?> target)
+    {
+        Asserts.assertNotNull(src, "src parameter can not be  null");
+        Asserts.assertNotNull(target, "target parameter can not be null");
+
+        int srcIndex = enabledDecorators.indexOf(src);
+        int targetIndex = enabledDecorators.indexOf(target);
+
+        if (srcIndex == -1 || targetIndex == -1)
+        {
+            throw new IllegalArgumentException("One of the compare class of the list : [" + src.getName() + "," + target.getName() + "]" + " is not contained in the enabled decorators list!");
+        }
+
+        if (srcIndex == targetIndex)
+            return 0;
+        else if (srcIndex < targetIndex)
+            return -1;
+        else
+            return 1;
+    }
+
+    public boolean isDecoratorEnabled(Class<?> decoratorClazz)
+    {
+        Asserts.nullCheckForClass(decoratorClazz, "decoratorClazz can not be null");
+
+        return enabledDecorators.contains(decoratorClazz);
+    }
 
 }
\ No newline at end of file

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecorator.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.decorator;
 
@@ -39,284 +36,278 @@
 
 public class WebBeansDecorator extends Decorator
 {
-	private static WebBeansLogger logger = WebBeansLogger.getLogger(WebBeansDecorator.class);
-	
-	/**Decorator class*/
-	private Class<?> clazz; 
-	
-	/**Decorates api types*/
-	private Set<Class<?>> decoratedTypes = new HashSet<Class<?>>();
-	
-	/**Delegate field class type*/
-	protected Class<?> delegateType;
-	
-	/**Delegate field binding types*/
-	protected Set<Annotation> delegateBindingTypes = new HashSet<Annotation>();
-	
-	/**Delegated component*/
-	private AbstractComponent<Object> delegateComponent;
-	
-	
-	public WebBeansDecorator(AbstractComponent<Object> delegateComponent)
-	{
-		super(ManagerImpl.getManager());
-		this.delegateComponent = delegateComponent;
-		this.clazz = delegateComponent.getReturnType();
-		
-		init();
-	}
-	
-	
-	protected void init()
-	{
-		ClassUtil.setInterfaceTypeHierarchy(this.decoratedTypes, this.clazz);
-		
-		if(this.decoratedTypes.contains(Serializable.class))
-		{
-			this.decoratedTypes.remove(Serializable.class);
-		}
-		
-		initDelegate();
-	}
-	
-	
-	protected void initDelegate()
-	{
-		Field field = ClassUtil.getFieldWithAnnotation(this.clazz, Decorates.class);
-		this.delegateType = field.getType();
-		
-		Annotation[] anns = field.getAnnotations();
-		
-		for(Annotation ann : anns)
-		{
-			if(AnnotationUtil.isBindingAnnotation(ann.annotationType()))
-			{
-				this.delegateBindingTypes.add(ann);
-			}
-		}
-
-	}
-	
-	public boolean isDecoratorMatch(Set<Class<?>> apiType, Set<Annotation> annotation)
-	{
-		boolean foundApi = false;
-		for(Class<?> clazz : apiType)
-		{
-			if(this.delegateType.equals(clazz))
-			{
-				foundApi = true;
-				break;
-			}
-		}
-		
-		boolean allBindingsOk = false;
-		if(foundApi)
-		{
-			for(Annotation annot : annotation)
-			{
-				boolean bindingOk = false;
-				for(Annotation bindingType : delegateBindingTypes)
-				{
-					if(AnnotationUtil.isAnnotationMemberExist(bindingType.annotationType(), annot, bindingType))
-					{
-						bindingOk = true;
-						break;
-					}
-				}
-				
-				if(bindingOk)
-				{
-					allBindingsOk = true;
-				}
-				else
-				{
-					allBindingsOk = false;
-					break;
-				}
-			}
-		}
-		
-		if(!allBindingsOk)
-		{
-			return false;
-		}
-		
-		return true;
-	}
-	
-	@Override
-	public Set<Annotation> getDelegateBindingTypes()
-	{
-		return delegateBindingTypes;
-	}
-
-	@Override
-	public Class<?> getDelegateType()
-	{
-		return delegateType;
-	}
-
-	@Override
-	public void setDelegate(Object instance, Object delegate)
-	{
-		Field field = ClassUtil.getFieldWithAnnotation(getClazz(), Decorates.class);	
-		if(!field.isAccessible())
-		{
-			field.setAccessible(true);
-		}
-		
-		try
-		{
-			field.set(instance, delegate);
-			
-		} catch (IllegalArgumentException e)
-		{
-			logger.error("Delegate field is not found on the given decorator class : " + instance.getClass().getName(), e);
-			throw new WebBeansException(e);
-			
-		}catch(IllegalAccessException e)
-		{
-			logger.error("Illegal access exception for field "+ field.getName() + " in decorator class : " + instance.getClass().getName(),e);
-		}
-		
-
-	}
-	@Override
-	public Object create()
-	{
-		Object proxy = JavassistProxyFactory.createNewProxyInstance(this);
-				
-		return proxy;
-	}
-	
-	public void setInjections(Object proxy)
-	{
-		//Set injected fields
-		ComponentImpl<Object> delegate = (ComponentImpl<Object>)this.delegateComponent;
-		
-		Set<Field> injectedFields = delegate.getInjectedFields();
-		for(Field injectedField : injectedFields)
-		{
-			boolean isDecorates = injectedField.isAnnotationPresent(Decorates.class);
-			
-			if(!isDecorates)
-			{
-				InjectableField ife = new InjectableField(injectedField,proxy,this.delegateComponent);
-				ife.doInjection();				
-			}
-		}
-		
-		Set<Method> injectedMethods = delegate.getInjectedMethods();
-		for(Method injectedMethod : injectedMethods)
-		{
-			@SuppressWarnings("unchecked")
-			InjectableMethods<?> ife = new InjectableMethods(injectedMethod,proxy,this.delegateComponent);
-			ife.doInjection();
-		}
-	}
-
-	@Override
-	public void destroy(Object instance)
-	{
-		delegateComponent.destroy(instance);
-	}
-
-	@Override
-	public Set<Annotation> getBindingTypes()
-	{
-		return delegateComponent.getBindingTypes();
-	}
-
-	@Override
-	public Class<? extends Annotation> getDeploymentType()
-	{
-		return delegateComponent.getDeploymentType();
-	}
-
-	@Override
-	public String getName()
-	{
-		return delegateComponent.getName();
-	}
-
-	@Override
-	public Class<? extends Annotation> getScopeType()
-	{
-		return delegateComponent.getScopeType();
-	}
-
-	@Override
-	public Set<Class<?>> getTypes()
-	{
-		return delegateComponent.getTypes();
-	}
-
-	@Override
-	public boolean isNullable()
-	{
-		return delegateComponent.isNullable();
-	}
-
-	@Override
-	public boolean isSerializable()
-	{
-		return delegateComponent.isSerializable();
-	}
-
-	
-
-	/**
-	 * @return the delegateComponent
-	 */
-	public AbstractComponent<Object> getDelegateComponent()
-	{
-		return delegateComponent;
-	}
-
-
-	/**
-	 * @return the clazz
-	 */
-	public Class<?> getClazz()
-	{
-		return clazz;
-	}
-
-
-	/* (non-Javadoc)
-	 * @see java.lang.Object#hashCode()
-	 */
-	@Override
-	public int hashCode()
-	{
-		final int prime = 31;
-		int result = 1;
-		result = prime * result + ((clazz == null) ? 0 : clazz.hashCode());
-		return result;
-	}
-
-
-	/* (non-Javadoc)
-	 * @see java.lang.Object#equals(java.lang.Object)
-	 */
-	@Override
-	public boolean equals(Object obj)
-	{
-		if (this == obj)
-			return true;
-		if (obj == null)
-			return false;
-		if (getClass() != obj.getClass())
-			return false;
-		final WebBeansDecorator other = (WebBeansDecorator) obj;
-		if (clazz == null)
-		{
-			if (other.clazz != null)
-				return false;
-		} else if (!clazz.equals(other.clazz))
-			return false;
-		return true;
-	}
+    private static WebBeansLogger logger = WebBeansLogger.getLogger(WebBeansDecorator.class);
+
+    /** Decorator class */
+    private Class<?> clazz;
+
+    /** Decorates api types */
+    private Set<Class<?>> decoratedTypes = new HashSet<Class<?>>();
+
+    /** Delegate field class type */
+    protected Class<?> delegateType;
+
+    /** Delegate field binding types */
+    protected Set<Annotation> delegateBindingTypes = new HashSet<Annotation>();
+
+    /** Delegated component */
+    private AbstractComponent<Object> delegateComponent;
+
+    public WebBeansDecorator(AbstractComponent<Object> delegateComponent)
+    {
+        super(ManagerImpl.getManager());
+        this.delegateComponent = delegateComponent;
+        this.clazz = delegateComponent.getReturnType();
+
+        init();
+    }
+
+    protected void init()
+    {
+        ClassUtil.setInterfaceTypeHierarchy(this.decoratedTypes, this.clazz);
+
+        if (this.decoratedTypes.contains(Serializable.class))
+        {
+            this.decoratedTypes.remove(Serializable.class);
+        }
+
+        initDelegate();
+    }
+
+    protected void initDelegate()
+    {
+        Field field = ClassUtil.getFieldWithAnnotation(this.clazz, Decorates.class);
+        this.delegateType = field.getType();
+
+        Annotation[] anns = field.getAnnotations();
+
+        for (Annotation ann : anns)
+        {
+            if (AnnotationUtil.isBindingAnnotation(ann.annotationType()))
+            {
+                this.delegateBindingTypes.add(ann);
+            }
+        }
+
+    }
+
+    public boolean isDecoratorMatch(Set<Class<?>> apiType, Set<Annotation> annotation)
+    {
+        boolean foundApi = false;
+        for (Class<?> clazz : apiType)
+        {
+            if (this.delegateType.equals(clazz))
+            {
+                foundApi = true;
+                break;
+            }
+        }
+
+        boolean allBindingsOk = false;
+        if (foundApi)
+        {
+            for (Annotation annot : annotation)
+            {
+                boolean bindingOk = false;
+                for (Annotation bindingType : delegateBindingTypes)
+                {
+                    if (AnnotationUtil.isAnnotationMemberExist(bindingType.annotationType(), annot, bindingType))
+                    {
+                        bindingOk = true;
+                        break;
+                    }
+                }
+
+                if (bindingOk)
+                {
+                    allBindingsOk = true;
+                } else
+                {
+                    allBindingsOk = false;
+                    break;
+                }
+            }
+        }
+
+        if (!allBindingsOk)
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    @Override
+    public Set<Annotation> getDelegateBindingTypes()
+    {
+        return delegateBindingTypes;
+    }
+
+    @Override
+    public Class<?> getDelegateType()
+    {
+        return delegateType;
+    }
+
+    @Override
+    public void setDelegate(Object instance, Object delegate)
+    {
+        Field field = ClassUtil.getFieldWithAnnotation(getClazz(), Decorates.class);
+        if (!field.isAccessible())
+        {
+            field.setAccessible(true);
+        }
+
+        try
+        {
+            field.set(instance, delegate);
+
+        } catch (IllegalArgumentException e)
+        {
+            logger.error("Delegate field is not found on the given decorator class : " + instance.getClass().getName(), e);
+            throw new WebBeansException(e);
+
+        } catch (IllegalAccessException e)
+        {
+            logger.error("Illegal access exception for field " + field.getName() + " in decorator class : " + instance.getClass().getName(), e);
+        }
+
+    }
+
+    @Override
+    public Object create()
+    {
+        Object proxy = JavassistProxyFactory.createNewProxyInstance(this);
+
+        return proxy;
+    }
+
+    public void setInjections(Object proxy)
+    {
+        // Set injected fields
+        ComponentImpl<Object> delegate = (ComponentImpl<Object>) this.delegateComponent;
+
+        Set<Field> injectedFields = delegate.getInjectedFields();
+        for (Field injectedField : injectedFields)
+        {
+            boolean isDecorates = injectedField.isAnnotationPresent(Decorates.class);
+
+            if (!isDecorates)
+            {
+                InjectableField ife = new InjectableField(injectedField, proxy, this.delegateComponent);
+                ife.doInjection();
+            }
+        }
+
+        Set<Method> injectedMethods = delegate.getInjectedMethods();
+        for (Method injectedMethod : injectedMethods)
+        {
+            @SuppressWarnings("unchecked")
+            InjectableMethods<?> ife = new InjectableMethods(injectedMethod, proxy, this.delegateComponent);
+            ife.doInjection();
+        }
+    }
+
+    @Override
+    public void destroy(Object instance)
+    {
+        delegateComponent.destroy(instance);
+    }
+
+    @Override
+    public Set<Annotation> getBindingTypes()
+    {
+        return delegateComponent.getBindingTypes();
+    }
+
+    @Override
+    public Class<? extends Annotation> getDeploymentType()
+    {
+        return delegateComponent.getDeploymentType();
+    }
+
+    @Override
+    public String getName()
+    {
+        return delegateComponent.getName();
+    }
+
+    @Override
+    public Class<? extends Annotation> getScopeType()
+    {
+        return delegateComponent.getScopeType();
+    }
+
+    @Override
+    public Set<Class<?>> getTypes()
+    {
+        return delegateComponent.getTypes();
+    }
+
+    @Override
+    public boolean isNullable()
+    {
+        return delegateComponent.isNullable();
+    }
+
+    @Override
+    public boolean isSerializable()
+    {
+        return delegateComponent.isSerializable();
+    }
+
+    /**
+     * @return the delegateComponent
+     */
+    public AbstractComponent<Object> getDelegateComponent()
+    {
+        return delegateComponent;
+    }
+
+    /**
+     * @return the clazz
+     */
+    public Class<?> getClazz()
+    {
+        return clazz;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((clazz == null) ? 0 : clazz.hashCode());
+        return result;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        final WebBeansDecorator other = (WebBeansDecorator) obj;
+        if (clazz == null)
+        {
+            if (other.clazz != null)
+                return false;
+        } else if (!clazz.equals(other.clazz))
+            return false;
+        return true;
+    }
 
-	
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.decorator;
 
@@ -35,96 +32,94 @@
 
 public final class WebBeansDecoratorConfig
 {
-	private static WebBeansLogger logger = WebBeansLogger.getLogger(WebBeansDecoratorConfig.class);
+    private static WebBeansLogger logger = WebBeansLogger.getLogger(WebBeansDecoratorConfig.class);
 
+    private WebBeansDecoratorConfig()
+    {
+
+    }
+
+    public static void configureDecoratorClass(AbstractComponent<Object> delegate)
+    {
+        logger.info("Configuring the Web Beans Annoatated Decorator Class : " + delegate.getReturnType().getName() + " started");
+
+        WebBeansDecorator decorator = new WebBeansDecorator(delegate);
+
+        logger.info("Configuring the Web Beans Annotated Decorator Class : " + delegate.getReturnType() + " ended");
+
+        ManagerImpl.getManager().addDecorator(decorator);
+    }
+
+    public static void configureXMLDecoratorClass(AbstractComponent<Object> delegate, XMLInjectionPointModel model)
+    {
+        logger.info("Configuring the Web Beans XML based Decorator Class : " + delegate.getReturnType().getName() + " started");
+
+        WebBeansXMLDecorator decorator = new WebBeansXMLDecorator(delegate, model);
+
+        logger.info("Configuring the Web Beans XML based Decorator Class : " + delegate.getReturnType() + " ended");
+
+        ManagerImpl.getManager().addDecorator(decorator);
+    }
+
+    public static void configureDecarotors(AbstractComponent<?> component, Object instance)
+    {
+        Set<Annotation> bindingTypes = component.getBindingTypes();
+        Annotation[] anns = new Annotation[bindingTypes.size()];
+        anns = bindingTypes.toArray(anns);
+
+        List<Decorator> decoratorList = ManagerImpl.getManager().resolveDecorators(component.getTypes(), anns);
+        Iterator<Decorator> itList = decoratorList.iterator();
+
+        while (itList.hasNext())
+        {
+            WebBeansDecorator decorator = (WebBeansDecorator) itList.next();
+
+            Object decoratorInstance = ManagerImpl.getManager().getInstance(decorator);
+
+            decorator.setInjections(decoratorInstance);
+            decorator.setDelegate(decoratorInstance, instance);
+
+            component.getDecoratorStack().add(decoratorInstance);
+        }
+    }
+
+    private static Set<Decorator> getWebBeansDecorators()
+    {
+        return Collections.unmodifiableSet(ManagerImpl.getManager().getDecorators());
+    }
+
+    public static Set<Decorator> findDeployedWebBeansDecorator(Set<Class<?>> apiType, Annotation... anns)
+    {
+        Set<Decorator> set = new HashSet<Decorator>();
+
+        Iterator<Decorator> it = getWebBeansDecorators().iterator();
+        WebBeansDecorator decorator = null;
+
+        List<Class<? extends Annotation>> bindingTypes = new ArrayList<Class<? extends Annotation>>();
+        Set<Annotation> listAnnot = new HashSet<Annotation>();
+        for (Annotation ann : anns)
+        {
+            bindingTypes.add(ann.annotationType());
+            listAnnot.add(ann);
+        }
+
+        if (listAnnot.isEmpty())
+        {
+            listAnnot.add(new CurrentLiteral());
+        }
+
+        while (it.hasNext())
+        {
+            decorator = (WebBeansDecorator) it.next();
+
+            if (decorator.isDecoratorMatch(apiType, listAnnot))
+            {
+                set.add(decorator);
+            }
+        }
+
+        return set;
+
+    }
 
-	private WebBeansDecoratorConfig()
-	{
-		
-	}
-	
-	public static void configureDecoratorClass(AbstractComponent<Object> delegate)
-	{
-		logger.info("Configuring the Web Beans Annoatated Decorator Class : " + delegate.getReturnType().getName() + " started");
-
-		WebBeansDecorator decorator = new WebBeansDecorator(delegate);
-
-		logger.info("Configuring the Web Beans Annotated Decorator Class : " + delegate.getReturnType() + " ended");
-
-		ManagerImpl.getManager().addDecorator(decorator);
-	}
-
-	public static void configureXMLDecoratorClass(AbstractComponent<Object> delegate, XMLInjectionPointModel model)
-	{
-		logger.info("Configuring the Web Beans XML based Decorator Class : " + delegate.getReturnType().getName() + " started");
-
-		WebBeansXMLDecorator decorator = new WebBeansXMLDecorator(delegate,model);
-
-		logger.info("Configuring the Web Beans XML based Decorator Class : " + delegate.getReturnType() + " ended");
-
-		ManagerImpl.getManager().addDecorator(decorator);
-	}
-	
-	public static void configureDecarotors(AbstractComponent<?> component, Object instance)
-	{
-		Set<Annotation> bindingTypes = component.getBindingTypes();
-		Annotation[] anns = new Annotation[bindingTypes.size()];
-		anns = bindingTypes.toArray(anns);
-		
-		List<Decorator> decoratorList = ManagerImpl.getManager().resolveDecorators(component.getTypes(), anns);
-		Iterator<Decorator> itList = decoratorList.iterator();
-		
-		while(itList.hasNext())
-		{
-			WebBeansDecorator decorator = (WebBeansDecorator)itList.next();
-			
-			Object decoratorInstance =  ManagerImpl.getManager().getInstance(decorator);
-			
-			decorator.setInjections(decoratorInstance);
-			decorator.setDelegate(decoratorInstance, instance);
-		
-			component.getDecoratorStack().add(decoratorInstance);			
-		}
-	}
-	
-	private static Set<Decorator> getWebBeansDecorators()
-	{
-		return Collections.unmodifiableSet(ManagerImpl.getManager().getDecorators());
-	}
-
-	
-	public static Set<Decorator> findDeployedWebBeansDecorator(Set<Class<?>> apiType, Annotation...anns)
-	{
-		Set<Decorator> set = new HashSet<Decorator>();
-
-		Iterator<Decorator> it = getWebBeansDecorators().iterator();
-		WebBeansDecorator decorator = null;
-
-		List<Class<? extends Annotation>> bindingTypes = new ArrayList<Class<? extends Annotation>>();
-		Set<Annotation> listAnnot = new HashSet<Annotation>();
-		for (Annotation ann : anns)
-		{
-			bindingTypes.add(ann.annotationType());
-			listAnnot.add(ann);
-		}
-		
-		if(listAnnot.isEmpty())
-		{
-			listAnnot.add(new CurrentLiteral());
-		}
-
-		while (it.hasNext())
-		{
-			decorator = (WebBeansDecorator) it.next();
-			
-			if(decorator.isDecoratorMatch(apiType, listAnnot))
-			{
-				set.add(decorator);
-			}
-		}
-
-		return set;
-		
-	}
-	
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/xml/WebBeansXMLDecorator.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/xml/WebBeansXMLDecorator.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/xml/WebBeansXMLDecorator.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/xml/WebBeansXMLDecorator.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.decorator.xml;
 
@@ -22,24 +19,25 @@
 
 public class WebBeansXMLDecorator extends WebBeansDecorator
 {
-	private XMLInjectionPointModel decoratesModel = null;
-	
-	public WebBeansXMLDecorator(AbstractComponent<Object> delegateComponent, XMLInjectionPointModel model)
-	{
-		super(delegateComponent);
-		this.decoratesModel = model;
-		
-	}
-
-	/* (non-Javadoc)
-	 * @see org.apache.webbeans.decorator.WebBeansDecorator#initDelegate()
-	 */
-	@Override
-	protected void initDelegate()
-	{
-		this.delegateType = decoratesModel.getInjectionClassType();
-		this.delegateBindingTypes = decoratesModel.getBindingTypes();
-	}
+    private XMLInjectionPointModel decoratesModel = null;
+
+    public WebBeansXMLDecorator(AbstractComponent<Object> delegateComponent, XMLInjectionPointModel model)
+    {
+        super(delegateComponent);
+        this.decoratesModel = model;
+
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.webbeans.decorator.WebBeansDecorator#initDelegate()
+     */
+    @Override
+    protected void initDelegate()
+    {
+        this.delegateType = decoratesModel.getInjectionClassType();
+        this.delegateBindingTypes = decoratesModel.getBindingTypes();
+    }
 
-	
 }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/DeploymentTypeManager.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/DeploymentTypeManager.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/DeploymentTypeManager.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/DeploymentTypeManager.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.deployment;
 
@@ -27,71 +24,68 @@
 
 public class DeploymentTypeManager
 {
-	private Map<Class<? extends Annotation>, Integer> deploymentTypeMap = new ConcurrentHashMap<Class<? extends Annotation>, Integer>();  
-	
-	public DeploymentTypeManager()
-	{
-		
-	}
-	
-	public static DeploymentTypeManager getInstance()
-	{
-		DeploymentTypeManager instance = (DeploymentTypeManager) WebBeansFinder.getSingletonInstance(WebBeansFinder.SINGLETON_DEPLOYMENT_TYPE_MANAGER);
-		instance.deploymentTypeMap.put(Standard.class, Integer.valueOf(0));
-		
-		return instance;
-	}
-	
-	
-	public void addNewDeploymentType(Class<? extends Annotation> deploymentType,Integer precedence)
-	{
-		Asserts.assertNotNull(deploymentType, "deploymentType parameter can not be null");
-		Asserts.assertNotNull(precedence,"predence parameter can not be null");
-		
-		if(!deploymentType.equals(Standard.class))
-		{
-			if(!deploymentTypeMap.containsKey(deploymentType))
-			{
-				deploymentTypeMap.put(deploymentType, precedence);
-			}
-		}
-	}
-	
-	public int getPrecedence(Class<? extends Annotation> deploymentType)
-	{
-		Asserts.assertNotNull(deploymentType, "deploymentType parameter can not be null");
-		
-		if(!deploymentTypeMap.containsKey(deploymentType))
-		{
-			throw new IllegalArgumentException("Deployment type with annotation class : " + deploymentType.getName() + " is not applicable");
-		}
-		else
-		{
-			return deploymentTypeMap.get(deploymentType);
-		}
-	}
-	
-	public int comparePrecedences(Class<? extends Annotation> typeFirst, Class<? extends Annotation> typeSecond)
-	{
-		Asserts.assertNotNull(typeFirst, "typeFirst parameter can not be null");
-		Asserts.assertNotNull(typeSecond, "typeSecond parameter can not be null");
-		
-		int precOne = getPrecedence(typeFirst);
-		int precSecond = getPrecedence(typeSecond);
-		
-		if(precOne == precSecond) 
-			return 0;
-		else if(precOne < precSecond) 
-			return -1;
-		else
-			return 1;
-		
-	}
-	
-	
-	public boolean isDeploymentTypeEnabled(Class<? extends Annotation> deploymentType)
-	{
-		Asserts.assertNotNull(deploymentType, "deploymentType parameter can not be null");
-		return deploymentTypeMap.containsKey(deploymentType);
-	}
+    private Map<Class<? extends Annotation>, Integer> deploymentTypeMap = new ConcurrentHashMap<Class<? extends Annotation>, Integer>();
+
+    public DeploymentTypeManager()
+    {
+
+    }
+
+    public static DeploymentTypeManager getInstance()
+    {
+        DeploymentTypeManager instance = (DeploymentTypeManager) WebBeansFinder.getSingletonInstance(WebBeansFinder.SINGLETON_DEPLOYMENT_TYPE_MANAGER);
+        instance.deploymentTypeMap.put(Standard.class, Integer.valueOf(0));
+
+        return instance;
+    }
+
+    public void addNewDeploymentType(Class<? extends Annotation> deploymentType, Integer precedence)
+    {
+        Asserts.assertNotNull(deploymentType, "deploymentType parameter can not be null");
+        Asserts.assertNotNull(precedence, "predence parameter can not be null");
+
+        if (!deploymentType.equals(Standard.class))
+        {
+            if (!deploymentTypeMap.containsKey(deploymentType))
+            {
+                deploymentTypeMap.put(deploymentType, precedence);
+            }
+        }
+    }
+
+    public int getPrecedence(Class<? extends Annotation> deploymentType)
+    {
+        Asserts.assertNotNull(deploymentType, "deploymentType parameter can not be null");
+
+        if (!deploymentTypeMap.containsKey(deploymentType))
+        {
+            throw new IllegalArgumentException("Deployment type with annotation class : " + deploymentType.getName() + " is not applicable");
+        } else
+        {
+            return deploymentTypeMap.get(deploymentType);
+        }
+    }
+
+    public int comparePrecedences(Class<? extends Annotation> typeFirst, Class<? extends Annotation> typeSecond)
+    {
+        Asserts.assertNotNull(typeFirst, "typeFirst parameter can not be null");
+        Asserts.assertNotNull(typeSecond, "typeSecond parameter can not be null");
+
+        int precOne = getPrecedence(typeFirst);
+        int precSecond = getPrecedence(typeSecond);
+
+        if (precOne == precSecond)
+            return 0;
+        else if (precOne < precSecond)
+            return -1;
+        else
+            return 1;
+
+    }
+
+    public boolean isDeploymentTypeEnabled(Class<? extends Annotation> deploymentType)
+    {
+        Asserts.assertNotNull(deploymentType, "deploymentType parameter can not be null");
+        return deploymentTypeMap.containsKey(deploymentType);
+    }
 }
\ No newline at end of file

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeManager.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeManager.java?rev=732803&r1=732802&r2=732803&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeManager.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeManager.java Thu Jan  8 11:41:30 2009
@@ -1,18 +1,15 @@
 /*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You 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.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.deployment;
 
@@ -25,35 +22,35 @@
 
 public class StereoTypeManager
 {
-	private Map<String, IStereoTypeModel> stereoTypeMap = new ConcurrentHashMap<String, IStereoTypeModel>();
-	
-	public StereoTypeManager()
-	{
-		
-	}
-	
-	public static StereoTypeManager getInstance()
-	{
-		StereoTypeManager instance = (StereoTypeManager)WebBeansFinder.getSingletonInstance(WebBeansFinder.SINGLETON_STEREOTYPE_MANAGER);
-		return instance;
-	}
-	
-	public void addStereoTypeModel(IStereoTypeModel model)
-	{
-		Asserts.assertNotNull(model, "model parameter can not be null");
-		
-		stereoTypeMap.put(model.getName(), model);
-	}
-	
-	public IStereoTypeModel getStereoTypeModel(String modelName)
-	{
-		Asserts.assertNotNull(modelName, "modelName parameter can not be null");
-		
-		if(stereoTypeMap.containsKey(modelName))
-		{
-			return stereoTypeMap.get(modelName);
-		}
-		
-		return null;
-	}
+    private Map<String, IStereoTypeModel> stereoTypeMap = new ConcurrentHashMap<String, IStereoTypeModel>();
+
+    public StereoTypeManager()
+    {
+
+    }
+
+    public static StereoTypeManager getInstance()
+    {
+        StereoTypeManager instance = (StereoTypeManager) WebBeansFinder.getSingletonInstance(WebBeansFinder.SINGLETON_STEREOTYPE_MANAGER);
+        return instance;
+    }
+
+    public void addStereoTypeModel(IStereoTypeModel model)
+    {
+        Asserts.assertNotNull(model, "model parameter can not be null");
+
+        stereoTypeMap.put(model.getName(), model);
+    }
+
+    public IStereoTypeModel getStereoTypeModel(String modelName)
+    {
+        Asserts.assertNotNull(modelName, "modelName parameter can not be null");
+
+        if (stereoTypeMap.containsKey(modelName))
+        {
+            return stereoTypeMap.get(modelName);
+        }
+
+        return null;
+    }
 }



Mime
View raw message