[webbeans-commits] Webbeans SVN: r1662 - in ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans: context/beanstore and 4 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Mon Feb 23 15:50:23 EST 2009
Author: nickarls
Date: 2009-02-23 15:50:23 -0500 (Mon, 23 Feb 2009)
New Revision: 1662
Added:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/AbstractBeanStore.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/BeanStoreNamingScheme.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/PrefixBeanStoreNamingScheme.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/SimpleBeanStore.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanStore.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ConversationBeanStore.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/HttpSessionBeanStore.java
Removed:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanmap/
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/AbstractBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/BeanMapAdaptor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/SimpleBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/SimpleBeanMapAdaptor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ConversationBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/HttpSessionBeanMap.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/AbstractThreadLocalMapContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/ApplicationContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/ConversationContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/RequestContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/SessionContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/WebBeansPhaseListener.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/mock/MockLifecycle.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/AbstractLifecycle.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle2.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansServletFilter.java
Log:
beanmap -> beanstore
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -30,7 +30,7 @@
/**
* Base for the Context implementations. Delegates calls to the abstract
- * getBeanMap and getActive to allow for different implementations (storage
+ * getBeanStorage and getActive to allow for different implementations (storage
* types and ThreadLocal vs. shared)
*
* @author Nicklas Karlsson
@@ -69,7 +69,7 @@
{
throw new ContextNotActiveException();
}
- T instance = getBeanMap().get(contextual);
+ T instance = getBeanStorage().get(contextual);
if (instance != null)
{
return instance;
@@ -79,7 +79,7 @@
instance = contextual.create(creationalContext);
if (instance != null)
{
- getBeanMap().put(contextual, instance);
+ getBeanStorage().put(contextual, instance);
}
return instance;
}
@@ -103,7 +103,7 @@
private <T> void destroy(Contextual<T> bean)
{
log.trace("Destroying " + bean);
- bean.destroy(getBeanMap().get(bean));
+ bean.destroy(getBeanStorage().get(bean));
}
/**
@@ -112,11 +112,11 @@
public void destroy()
{
log.trace("Destroying context");
- for (Contextual<? extends Object> bean : getBeanMap().getBeans())
+ for (Contextual<? extends Object> bean : getBeanStorage().getBeans())
{
destroy(bean);
}
- getBeanMap().clear();
+ getBeanStorage().clear();
}
/**
@@ -124,6 +124,6 @@
*
* @return The actual bean map
*/
- protected abstract BeanStore getBeanMap();
+ protected abstract BeanStore getBeanStorage();
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/AbstractThreadLocalMapContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/AbstractThreadLocalMapContext.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/AbstractThreadLocalMapContext.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -19,10 +19,9 @@
* Gets the bean map
*
* @returns The bean map
- * @see org.jboss.webbeans.context.AbstractContext#getNewEnterpriseBeanMap()
*/
@Override
- public BeanStore getBeanMap()
+ public BeanStore getBeanStorage()
{
return beanStore.get();
}
@@ -32,7 +31,7 @@
*
* @param beanStore The bean map
*/
- public void setBeanMap(BeanStore beanStore)
+ public void setBeanStore(BeanStore beanStore)
{
this.beanStore.set(beanStore);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/ApplicationContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/ApplicationContext.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/ApplicationContext.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -61,7 +61,7 @@
* @return The bean map
*/
@Override
- public BeanStore getBeanMap()
+ public BeanStore getBeanStorage()
{
return this.beanStore;
}
@@ -69,11 +69,11 @@
/**
* Sets the bean map
*
- * @param applicationBeanMap The bean map
+ * @param applicationBeanStore The bean map
*/
- public void setBeanMap(BeanStore applicationBeanMap)
+ public void setBeanStore(BeanStore applicationBeanStore)
{
- this.beanStore = applicationBeanMap;
+ this.beanStore = applicationBeanStore;
}
/**
@@ -102,8 +102,8 @@
public String toString()
{
String active = isActive() ? "Active " : "Inactive ";
- String beanMapInfo = getBeanMap() == null ? "" : getBeanMap().toString();
- return active + "application context " + beanMapInfo;
+ String beanStoreInfo = getBeanStorage() == null ? "" : getBeanStorage().toString();
+ return active + "application context " + beanStoreInfo;
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/ConversationContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/ConversationContext.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/ConversationContext.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -52,8 +52,8 @@
public String toString()
{
String active = isActive() ? "Active " : "Inactive ";
- String beanMapInfo = getBeanMap() == null ? "" : getBeanMap().toString();
- return active + "conversation context " + beanMapInfo;
+ String beanStoreInfo = getBeanStorage() == null ? "" : getBeanStorage().toString();
+ return active + "conversation context " + beanStoreInfo;
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/RequestContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/RequestContext.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/RequestContext.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -47,8 +47,8 @@
public String toString()
{
String active = isActive() ? "Active " : "Inactive ";
- String beanMapInfo = getBeanMap() == null ? "" : getBeanMap().toString();
- return active + "request context " + beanMapInfo;
+ String beanStoreInfo = getBeanStorage() == null ? "" : getBeanStorage().toString();
+ return active + "request context " + beanStoreInfo;
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/SessionContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/SessionContext.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/SessionContext.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -52,8 +52,8 @@
public String toString()
{
String active = isActive() ? "Active " : "Inactive ";
- String beanMapInfo = getBeanMap() == null ? "" : getBeanMap().toString();
- return active + "session context " + beanMapInfo;
+ String beanStoreInfo = getBeanStorage() == null ? "" : getBeanStorage().toString();
+ return active + "session context " + beanStoreInfo;
}
}
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore (from rev 1661, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanmap)
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/AbstractBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanmap/AbstractBeanMap.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/AbstractBeanMap.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -1,181 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.webbeans.context.beanmap;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-
-import javax.context.Contextual;
-
-import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.context.api.BeanStore;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.util.EnumerationIterable;
-import org.jboss.webbeans.util.Names;
-
-/**
- * Provides common BeanMap operations
- *
- * @author Nicklas Karlsson
- *
- */
-public abstract class AbstractBeanMap implements BeanStore
-{
- // The log provider
- private static LogProvider log = Logging.getLogProvider(AbstractBeanMap.class);
-
- /**
- * Gets a bean from the map
- *
- * @param contextual The bean to get
- * @return The instance
- */
- @SuppressWarnings("unchecked")
- public <T> T get(Contextual<? extends T> contextual)
- {
- String key = getBeanMapAdaptor().getContextualKey(contextual);
- T instance = (T) getAttribute(key);
- log.trace("Looked for " + key + " and got " + instance);
- return instance;
- }
-
- /**
- * Removes an instance from the map
- *
- * @param contextual The bean of the instance to remove
- * @return The removed instance
- */
- public <T> T remove(Contextual<? extends T> contextual)
- {
- T instance = get(contextual);
- String key = getBeanMapAdaptor().getContextualKey(contextual);
- removeAttribute(key);
- log.trace("Removed bean under key " + key);
- return instance;
- }
-
- /**
- * Clears the bean map
- */
- public void clear()
- {
- for (String attributeName : getFilteredAttributeNames())
- {
- removeAttribute(attributeName);
- }
- log.trace("Bean Map cleared");
- }
-
- /**
- * Returns the beans present in the map
- *
- * @return The beans
- */
- public Iterable<Contextual<? extends Object>> getBeans()
- {
- List<Contextual<?>> contextuals = new ArrayList<Contextual<?>>();
- BeanMapAdaptor adaptor = getBeanMapAdaptor();
- for (String attributeName : getFilteredAttributeNames())
- {
- int beanIndex = adaptor.getBeanIndexFromKey(attributeName);
- Contextual<?> contextual = CurrentManager.rootManager().getBeans().get(beanIndex);
- contextuals.add(contextual);
- }
- return contextuals;
- }
-
- /**
- * Gets the list of attribute names that is held by the bean map
- *
- * @return The list of attribute names
- */
- private List<String> getFilteredAttributeNames()
- {
- List<String> attributeNames = new ArrayList<String>();
- BeanMapAdaptor adaptor = getBeanMapAdaptor();
- for (String attributeName : new EnumerationIterable<String>(getAttributeNames()))
- {
- if (adaptor.acceptKey(attributeName))
- {
- attributeNames.add(attributeName);
- }
- }
- return attributeNames;
- }
-
- /**
- * Puts an instance of a bean in the map
- *
- * @param bean The key bean
- * @param instance The instance
- * @return The instance added
- */
- public <T> void put(Contextual<? extends T> bean, T instance)
- {
- String key = getBeanMapAdaptor().getContextualKey(bean);
- setAttribute(key, instance);
- log.trace("Added bean " + bean + " under key " + key);
- }
-
- /**
- * Gets an attribute from the underlying storage
- *
- * @param key The key of the attribute
- * @return The data
- */
- protected abstract Object getAttribute(String key);
-
- /**
- * Removes an attribute from the underlying storage
- *
- * @param key The attribute to remove
- */
- protected abstract void removeAttribute(String key);
-
- /**
- * Gets an enumeration of the attribute names present in the underlying
- * storage
- *
- * @return The attribute names
- */
- protected abstract Enumeration<String> getAttributeNames();
-
- /**
- * Sets an instance under a key in the underlying storage
- *
- * @param key The key
- * @param instance The instance
- */
- protected abstract void setAttribute(String key, Object instance);
-
- /**
- * Gets an adaptor for handling keys in a bean map
- *
- * @return The filter
- */
- protected abstract BeanMapAdaptor getBeanMapAdaptor();
-
-
- @Override
- public String toString()
- {
- return "holding " + Names.count(getBeans()) + " instances";
- }
-}
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/AbstractBeanStore.java (from rev 1661, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanmap/AbstractBeanMap.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/AbstractBeanStore.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/AbstractBeanStore.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -0,0 +1,181 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.webbeans.context.beanstore;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.context.Contextual;
+
+import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.context.api.BeanStore;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.util.EnumerationIterable;
+import org.jboss.webbeans.util.Names;
+
+/**
+ * Provides common BeanStore operations
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+public abstract class AbstractBeanStore implements BeanStore
+{
+ // The log provider
+ private static LogProvider log = Logging.getLogProvider(AbstractBeanStore.class);
+
+ /**
+ * Gets a bean from the map
+ *
+ * @param contextual The bean to get
+ * @return The instance
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T get(Contextual<? extends T> contextual)
+ {
+ String key = getBeanNamingScheme().getContextualKey(contextual);
+ T instance = (T) getAttribute(key);
+ log.trace("Looked for " + key + " and got " + instance);
+ return instance;
+ }
+
+ /**
+ * Removes an instance from the map
+ *
+ * @param contextual The bean of the instance to remove
+ * @return The removed instance
+ */
+ public <T> T remove(Contextual<? extends T> contextual)
+ {
+ T instance = get(contextual);
+ String key = getBeanNamingScheme().getContextualKey(contextual);
+ removeAttribute(key);
+ log.trace("Removed bean under key " + key);
+ return instance;
+ }
+
+ /**
+ * Clears the bean map
+ */
+ public void clear()
+ {
+ for (String attributeName : getFilteredAttributeNames())
+ {
+ removeAttribute(attributeName);
+ }
+ log.trace("Bean Map cleared");
+ }
+
+ /**
+ * Returns the beans present in the map
+ *
+ * @return The beans
+ */
+ public Iterable<Contextual<? extends Object>> getBeans()
+ {
+ List<Contextual<?>> contextuals = new ArrayList<Contextual<?>>();
+ BeanStoreNamingScheme namingScheme = getBeanNamingScheme();
+ for (String attributeName : getFilteredAttributeNames())
+ {
+ int beanIndex = namingScheme.getBeanIndexFromKey(attributeName);
+ Contextual<?> contextual = CurrentManager.rootManager().getBeans().get(beanIndex);
+ contextuals.add(contextual);
+ }
+ return contextuals;
+ }
+
+ /**
+ * Gets the list of attribute names that is held by the bean map
+ *
+ * @return The list of attribute names
+ */
+ private List<String> getFilteredAttributeNames()
+ {
+ List<String> attributeNames = new ArrayList<String>();
+ BeanStoreNamingScheme namingScheme = getBeanNamingScheme();
+ for (String attributeName : new EnumerationIterable<String>(getAttributeNames()))
+ {
+ if (namingScheme.acceptKey(attributeName))
+ {
+ attributeNames.add(attributeName);
+ }
+ }
+ return attributeNames;
+ }
+
+ /**
+ * Puts an instance of a bean in the map
+ *
+ * @param bean The key bean
+ * @param instance The instance
+ * @return The instance added
+ */
+ public <T> void put(Contextual<? extends T> bean, T instance)
+ {
+ String key = getBeanNamingScheme().getContextualKey(bean);
+ setAttribute(key, instance);
+ log.trace("Added bean " + bean + " under key " + key);
+ }
+
+ /**
+ * Gets an attribute from the underlying storage
+ *
+ * @param key The key of the attribute
+ * @return The data
+ */
+ protected abstract Object getAttribute(String key);
+
+ /**
+ * Removes an attribute from the underlying storage
+ *
+ * @param key The attribute to remove
+ */
+ protected abstract void removeAttribute(String key);
+
+ /**
+ * Gets an enumeration of the attribute names present in the underlying
+ * storage
+ *
+ * @return The attribute names
+ */
+ protected abstract Enumeration<String> getAttributeNames();
+
+ /**
+ * Sets an instance under a key in the underlying storage
+ *
+ * @param key The key
+ * @param instance The instance
+ */
+ protected abstract void setAttribute(String key, Object instance);
+
+ /**
+ * Gets an naming scheme for handling keys in a bean map
+ *
+ * @return The naming scheme
+ */
+ protected abstract BeanStoreNamingScheme getBeanNamingScheme();
+
+
+ @Override
+ public String toString()
+ {
+ return "holding " + Names.count(getBeans()) + " instances";
+ }
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/AbstractBeanStore.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/BeanMapAdaptor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanmap/BeanMapAdaptor.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/BeanMapAdaptor.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.context.beanmap;
-
-import javax.context.Contextual;
-
-/**
- * Interface against a BeanMap to handle different naming schemes
- *
- * @author Nicklas Karlsson
- *
- */
-public interface BeanMapAdaptor
-{
- /**
- * Checks if a key is handled by the bean map
- *
- * @param key The key to match
- * @return True if match, false otherwise
- */
- public abstract boolean acceptKey(String key);
-
- /**
- * Gets a bean map key for a contextual
- *
- * @param contextual The contextual to make the key for
- * @return A map key
- */
- public abstract String getContextualKey(Contextual<?> contextual);
-
- /**
- * Gets a bean index key from a key
- *
- * @param key The key to parse
- * @return The bean index
- */
- public abstract int getBeanIndexFromKey(String key);
-}
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/BeanStoreNamingScheme.java (from rev 1657, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanmap/BeanMapAdaptor.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/BeanStoreNamingScheme.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/BeanStoreNamingScheme.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.context.beanstore;
+
+import javax.context.Contextual;
+
+/**
+ * Interface against a BeanStore to handle different naming schemes
+ *
+ * @author Nicklas Karlsson
+ *
+ */
+public interface BeanStoreNamingScheme
+{
+ /**
+ * Checks if a key is handled by the bean map
+ *
+ * @param key The key to match
+ * @return True if match, false otherwise
+ */
+ public abstract boolean acceptKey(String key);
+
+ /**
+ * Gets a bean map key for a contextual
+ *
+ * @param contextual The contextual to make the key for
+ * @return A map key
+ */
+ public abstract String getContextualKey(Contextual<?> contextual);
+
+ /**
+ * Gets a bean index key from a key
+ *
+ * @param key The key to parse
+ * @return The bean index
+ */
+ public abstract int getBeanIndexFromKey(String key);
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/BeanStoreNamingScheme.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/PrefixBeanStoreNamingScheme.java (from rev 1657, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanmap/SimpleBeanMapAdaptor.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/PrefixBeanStoreNamingScheme.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/PrefixBeanStoreNamingScheme.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.context.beanstore;
+
+import javax.context.Contextual;
+
+import org.jboss.webbeans.CurrentManager;
+
+/**
+ * Simple prefix-based implementation of a bean map naming scheme
+ *
+ * @author Nicklas Karlsson
+ */
+public class PrefixBeanStoreNamingScheme implements BeanStoreNamingScheme
+{
+ public String prefix;
+ public String delimeter;
+
+ public PrefixBeanStoreNamingScheme(String prefix, String delimeter)
+ {
+ if (prefix.indexOf(delimeter) >= 0)
+ {
+ throw new IllegalArgumentException("The prefix '" + prefix + "' shouldn't be in the prefix '" + prefix + "'");
+ }
+ this.prefix = prefix;
+ this.delimeter = delimeter;
+ }
+
+ public boolean acceptKey(String key)
+ {
+ return key.startsWith(prefix);
+ }
+
+ public int getBeanIndexFromKey(String key)
+ {
+ return Integer.parseInt(key.substring(prefix.length() + delimeter.length()));
+ }
+
+ public String getContextualKey(Contextual<?> contextual)
+ {
+ return prefix + delimeter + CurrentManager.rootManager().getBeans().indexOf(contextual);
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/PrefixBeanStoreNamingScheme.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/SimpleBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanmap/SimpleBeanMap.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/SimpleBeanMap.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -1,139 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.webbeans.context.beanmap;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.context.Contextual;
-import javax.inject.manager.Bean;
-
-import org.jboss.webbeans.context.api.BeanStore;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
-
-import com.google.common.collect.ForwardingMap;
-
-/**
- * A BeanMap that uses a simple forwarding HashMap as backing map
- *
- * @author Nicklas Karlsson
- */
-public class SimpleBeanMap extends ForwardingMap<Contextual<? extends Object>, Object> implements BeanStore
-{
- private static LogProvider log = Logging.getLogProvider(SimpleBeanMap.class);
-
- // The backing map
- protected Map<Contextual<? extends Object>, Object> delegate;
-
- /**
- * Constructor
- */
- public SimpleBeanMap()
- {
- delegate = new ConcurrentHashMap<Contextual<? extends Object>, Object>();
- }
-
- /**
- * Gets an instance from the map
- *
- * @param The bean to look for
- * @return An instance, if found
- *
- * @see org.jboss.webbeans.context.api.BeanStore#get(Bean)
- */
- public <T extends Object> T get(Contextual<? extends T> bean)
- {
- @SuppressWarnings("unchecked")
- T instance = (T) super.get(bean);
- log.trace("Searched bean map for " + bean + " and got " + instance);
- return instance;
- }
-
- /**
- * Gets the delegate for the map
- *
- * @return The delegate
- */
- @Override
- public Map<Contextual<? extends Object>, Object> delegate()
- {
- return delegate;
- }
-
- /**
- * Removed a instance from the map
- *
- * @param bean the bean to remove
- * @return The instance removed
- *
- * @see org.jboss.webbeans.context.api.BeanStore#remove(Bean)
- */
- public <T extends Object> T remove(Contextual<? extends T> bean)
- {
- @SuppressWarnings("unchecked")
- T instance = (T) super.remove(bean);
- log.trace("Removed instace " + instance + " for bean " + bean + " from the bean map");
- return instance;
- }
-
- /**
- * Clears the map
- *
- * @see org.jboss.webbeans.context.api.BeanStore#clear()
- */
- public void clear()
- {
- delegate.clear();
- log.trace("Bean map cleared");
- }
-
- /**
- * Returns the beans contained in the map
- *
- * @return The beans present
- *
- * @see org.jboss.webbeans.context.api.BeanStore#getBeans()
- */
- public Set<Contextual<? extends Object>> getBeans()
- {
- return delegate.keySet();
- }
-
- /**
- * Puts a bean instance under the bean key in the map
- *
- * @param bean The bean
- * @param instance the instance
- *
- * @see org.jboss.webbeans.context.api.BeanStore#put(Bean, Object)
- */
- public <T> void put(Contextual<? extends T> bean, T instance)
- {
- delegate.put(bean, instance);
- log.trace("Stored instance " + instance + " for bean " + bean + " in bean map");
- }
-
- @Override
- public String toString()
- {
- return "holding " + delegate.size() + " instances";
- }
-
-}
\ No newline at end of file
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/SimpleBeanMapAdaptor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanmap/SimpleBeanMapAdaptor.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/SimpleBeanMapAdaptor.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.context.beanmap;
-
-import javax.context.Contextual;
-
-import org.jboss.webbeans.CurrentManager;
-
-/**
- * Simple prefix-based implementation of a bean map adaptor
- *
- * @author Nicklas Karlsson
- */
-public class SimpleBeanMapAdaptor implements BeanMapAdaptor
-{
- public String prefix;
-
- public SimpleBeanMapAdaptor(String prefix)
- {
- this.prefix = prefix;
- }
-
- public boolean acceptKey(String key)
- {
- return key.startsWith(prefix);
- }
-
- public int getBeanIndexFromKey(String key)
- {
- return Integer.parseInt(key.substring(prefix.length() + 1));
- }
-
- public String getContextualKey(Contextual<?> contextual)
- {
- return prefix + "#" + CurrentManager.rootManager().getBeans().indexOf(contextual);
- }
-
-}
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/SimpleBeanStore.java (from rev 1661, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanmap/SimpleBeanMap.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/SimpleBeanStore.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/SimpleBeanStore.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -0,0 +1,139 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.webbeans.context.beanstore;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.context.Contextual;
+import javax.inject.manager.Bean;
+
+import org.jboss.webbeans.context.api.BeanStore;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+
+import com.google.common.collect.ForwardingMap;
+
+/**
+ * A BeanStore that uses a simple forwarding HashMap as backing storage
+ *
+ * @author Nicklas Karlsson
+ */
+public class SimpleBeanStore extends ForwardingMap<Contextual<? extends Object>, Object> implements BeanStore
+{
+ private static LogProvider log = Logging.getLogProvider(SimpleBeanStore.class);
+
+ // The backing map
+ protected Map<Contextual<? extends Object>, Object> delegate;
+
+ /**
+ * Constructor
+ */
+ public SimpleBeanStore()
+ {
+ delegate = new ConcurrentHashMap<Contextual<? extends Object>, Object>();
+ }
+
+ /**
+ * Gets an instance from the map
+ *
+ * @param The bean to look for
+ * @return An instance, if found
+ *
+ * @see org.jboss.webbeans.context.api.BeanStore#get(Bean)
+ */
+ public <T extends Object> T get(Contextual<? extends T> bean)
+ {
+ @SuppressWarnings("unchecked")
+ T instance = (T) super.get(bean);
+ log.trace("Searched bean map for " + bean + " and got " + instance);
+ return instance;
+ }
+
+ /**
+ * Gets the delegate for the map
+ *
+ * @return The delegate
+ */
+ @Override
+ public Map<Contextual<? extends Object>, Object> delegate()
+ {
+ return delegate;
+ }
+
+ /**
+ * Removed a instance from the map
+ *
+ * @param bean the bean to remove
+ * @return The instance removed
+ *
+ * @see org.jboss.webbeans.context.api.BeanStore#remove(Bean)
+ */
+ public <T extends Object> T remove(Contextual<? extends T> bean)
+ {
+ @SuppressWarnings("unchecked")
+ T instance = (T) super.remove(bean);
+ log.trace("Removed instace " + instance + " for bean " + bean + " from the bean map");
+ return instance;
+ }
+
+ /**
+ * Clears the map
+ *
+ * @see org.jboss.webbeans.context.api.BeanStore#clear()
+ */
+ public void clear()
+ {
+ delegate.clear();
+ log.trace("Bean map cleared");
+ }
+
+ /**
+ * Returns the beans contained in the map
+ *
+ * @return The beans present
+ *
+ * @see org.jboss.webbeans.context.api.BeanStore#getBeans()
+ */
+ public Set<Contextual<? extends Object>> getBeans()
+ {
+ return delegate.keySet();
+ }
+
+ /**
+ * Puts a bean instance under the bean key in the map
+ *
+ * @param bean The bean
+ * @param instance the instance
+ *
+ * @see org.jboss.webbeans.context.api.BeanStore#put(Bean, Object)
+ */
+ public <T> void put(Contextual<? extends T> bean, T instance)
+ {
+ delegate.put(bean, instance);
+ log.trace("Stored instance " + instance + " for bean " + bean + " in bean map");
+ }
+
+ @Override
+ public String toString()
+ {
+ return "holding " + delegate.size() + " instances";
+ }
+
+}
\ No newline at end of file
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/context/beanstore/SimpleBeanStore.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -25,7 +25,7 @@
import org.jboss.webbeans.context.ConversationContext;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.servlet.ConversationBeanMap;
+import org.jboss.webbeans.servlet.ConversationBeanStore;
import org.jboss.webbeans.servlet.ServletLifecycle;
/**
@@ -92,7 +92,7 @@
/**
* Destroys the conversation and it's associated conversational context
*
- * @param session The HTTP session for the backing context beanmap
+ * @param session The HTTP session for the backing context bean store
*/
public void destroy(HttpSession session)
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/WebBeansPhaseListener.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/WebBeansPhaseListener.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/jsf/WebBeansPhaseListener.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -27,7 +27,7 @@
import org.jboss.webbeans.conversation.ConversationManager;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.servlet.ConversationBeanMap;
+import org.jboss.webbeans.servlet.ConversationBeanStore;
import org.jboss.webbeans.servlet.HttpSessionManager;
import org.jboss.webbeans.servlet.ServletLifecycle;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/mock/MockLifecycle.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/mock/MockLifecycle.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/mock/MockLifecycle.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -20,7 +20,7 @@
import org.jboss.webbeans.bootstrap.WebBeansBootstrap;
import org.jboss.webbeans.context.api.BeanStore;
-import org.jboss.webbeans.context.beanmap.SimpleBeanMap;
+import org.jboss.webbeans.context.beanstore.SimpleBeanStore;
import org.jboss.webbeans.ejb.spi.EjbResolver;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.servlet.AbstractLifecycle;
@@ -33,9 +33,9 @@
private final WebBeansBootstrap bootstrap;
private final MockWebBeanDiscovery webBeanDiscovery;
- private BeanStore applicationBeanMap = new SimpleBeanMap();
- private BeanStore sessionBeanMap = new SimpleBeanMap();
- private BeanStore requestBeanMap = new SimpleBeanMap();
+ private BeanStore applicationBeanStore = new SimpleBeanStore();
+ private BeanStore sessionBeanStore = new SimpleBeanStore();
+ private BeanStore requestBeanStore = new SimpleBeanStore();
public MockLifecycle()
{
@@ -75,12 +75,12 @@
public void beginApplication()
{
- super.beginApplication("Mock", applicationBeanMap);
- BeanStore requestBeanMap = new SimpleBeanMap();
- super.beginDeploy(requestBeanMap);
+ super.beginApplication("Mock", applicationBeanStore);
+ BeanStore requestBeanStore = new SimpleBeanStore();
+ super.beginDeploy(requestBeanStore);
bootstrap.setEjbDiscovery(new MockEjbDiscovery(webBeanDiscovery.discoverWebBeanClasses()));
bootstrap.boot();
- super.endDeploy(requestBeanMap);
+ super.endDeploy(requestBeanStore);
}
public void resetContexts()
@@ -90,28 +90,28 @@
public void endApplication()
{
- super.endApplication("Mock", applicationBeanMap);
+ super.endApplication("Mock", applicationBeanStore);
}
public void beginRequest()
{
- super.beginRequest("Mock", requestBeanMap);
+ super.beginRequest("Mock", requestBeanStore);
}
public void endRequest()
{
- super.endRequest("Mock", requestBeanMap);
+ super.endRequest("Mock", requestBeanStore);
}
public void beginSession()
{
- super.beginSession("Mock", sessionBeanMap);
+ super.beginSession("Mock", sessionBeanStore);
}
public void endSession()
{
// TODO Conversation handling breaks this :-(
- //super.endSession("Mock", sessionBeanMap);
+ //super.endSession("Mock", sessionBeanStore);
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/AbstractLifecycle.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/AbstractLifecycle.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/AbstractLifecycle.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -50,80 +50,80 @@
manager.addContext(ConversationContext.create());
}
- protected void beginApplication(String id, BeanStore applicationBeanMap)
+ protected void beginApplication(String id, BeanStore applicationBeanStore)
{
log.trace("Starting application " + id);
- ApplicationContext.INSTANCE.setBeanMap(applicationBeanMap);
+ ApplicationContext.INSTANCE.setBeanStore(applicationBeanStore);
ApplicationContext.INSTANCE.setActive(true);
}
- protected void beginDeploy(BeanStore requestBeanMap)
+ protected void beginDeploy(BeanStore requestBeanStore)
{
- RequestContext.INSTANCE.setBeanMap(requestBeanMap);
+ RequestContext.INSTANCE.setBeanStore(requestBeanStore);
RequestContext.INSTANCE.setActive(true);
}
- protected void endDeploy(BeanStore requestBeanMap)
+ protected void endDeploy(BeanStore requestBeanStore)
{
- RequestContext.INSTANCE.setBeanMap(null);
+ RequestContext.INSTANCE.setBeanStore(null);
RequestContext.INSTANCE.setActive(false);
}
- protected void endApplication(String id, BeanStore applicationBeanMap)
+ protected void endApplication(String id, BeanStore applicationBeanStore)
{
log.trace("Ending application " + id);
ApplicationContext.INSTANCE.destroy();
ApplicationContext.INSTANCE.setActive(false);
- ApplicationContext.INSTANCE.setBeanMap(null);
+ ApplicationContext.INSTANCE.setBeanStore(null);
}
- protected void beginSession(String id, BeanStore sessionBeanMap)
+ protected void beginSession(String id, BeanStore sessionBeanStore)
{
log.trace("Starting session " + id);
- SessionContext.INSTANCE.setBeanMap(sessionBeanMap);
+ SessionContext.INSTANCE.setBeanStore(sessionBeanStore);
SessionContext.INSTANCE.setActive(true);
}
- protected void endSession(String id, BeanStore sessionBeanMap)
+ protected void endSession(String id, BeanStore sessionBeanStore)
{
log.trace("Ending session " + id);
ConversationManager conversationManager = CurrentManager.rootManager().getInstanceByType(ConversationManager.class);
conversationManager.destroyAllConversations();
SessionContext.INSTANCE.destroy();
- SessionContext.INSTANCE.setBeanMap(null);
+ SessionContext.INSTANCE.setBeanStore(null);
SessionContext.INSTANCE.setActive(false);
}
- public void beginRequest(String id, BeanStore requestBeanMap)
+ public void beginRequest(String id, BeanStore requestBeanStore)
{
log.trace("Starting request " + id);
- RequestContext.INSTANCE.setBeanMap(requestBeanMap);
+ RequestContext.INSTANCE.setBeanStore(requestBeanStore);
RequestContext.INSTANCE.setActive(true);
DependentContext.INSTANCE.setActive(true);
}
- public void endRequest(String id, BeanStore requestBeanMap)
+ public void endRequest(String id, BeanStore requestBeanStore)
{
log.trace("Ending request " + id);
- RequestContext.INSTANCE.setBeanMap(requestBeanMap);
+ RequestContext.INSTANCE.setBeanStore(requestBeanStore);
DependentContext.INSTANCE.setActive(false);
RequestContext.INSTANCE.destroy();
RequestContext.INSTANCE.setActive(false);
}
- protected void restoreConversation(String id, BeanStore conversationBeanMap)
+ protected void restoreConversation(String id, BeanStore conversationBeanStore)
{
log.trace("Starting conversation " + id);
- ConversationContext.INSTANCE.setBeanMap(conversationBeanMap);
+ ConversationContext.INSTANCE.setBeanStore(conversationBeanStore);
ConversationContext.INSTANCE.setActive(true);
}
- protected void destroyConversation(String id, ConversationBeanMap conversationBeanMap)
+ protected void destroyConversation(String id, ConversationBeanStore conversationBeanStore)
{
log.trace("Ending conversation " + id);
ConversationContext destructionContext = new ConversationContext();
- destructionContext.setBeanMap(conversationBeanMap);
+ destructionContext.setBeanStore(conversationBeanStore);
destructionContext.destroy();
}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -1,95 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.webbeans.servlet;
-
-import java.util.Enumeration;
-
-import javax.servlet.ServletContext;
-
-import org.jboss.webbeans.context.ApplicationContext;
-import org.jboss.webbeans.context.beanmap.AbstractBeanMap;
-import org.jboss.webbeans.context.beanmap.BeanMapAdaptor;
-import org.jboss.webbeans.context.beanmap.SimpleBeanMapAdaptor;
-
-/**
- * A BeanMap that uses a servlet context as backing map
- *
- * @author Nicklas Karlsson
- *
- * @see org.jboss.webbeans.context.ApplicationContext
- */
-public class ApplicationBeanMap extends AbstractBeanMap
-{
- // The servlet context to use as backing map
- private ServletContext context;
-
- /**
- * Constructor
- *
- * @param context The servlet context instance
- */
- public ApplicationBeanMap(ServletContext context)
- {
- super();
- this.context = context;
- }
-
- /**
- * @see org.jboss.webbeans.context.beanmap.AbstractBeanMap#getAttribute()
- */
- @Override
- protected Object getAttribute(String key)
- {
- return context.getAttribute(key);
- }
-
- /**
- * @see org.jboss.webbeans.context.beanmap.AbstractBeanMap#getAttributeNames()
- */
- @SuppressWarnings("unchecked")
- @Override
- protected Enumeration<String> getAttributeNames()
- {
- return context.getAttributeNames();
- }
-
- /**
- * @see org.jboss.webbeans.context.beanmap.AbstractBeanMap#removeAttributes()
- */
- @Override
- protected void removeAttribute(String key)
- {
- context.removeAttribute(key);
- }
-
- /**
- * @see org.jboss.webbeans.context.beanmap.AbstractBeanMap#setAttribute()
- */
- @Override
- protected void setAttribute(String key, Object instance)
- {
- context.setAttribute(key, instance);
- }
-
- @Override
- protected BeanMapAdaptor getBeanMapAdaptor()
- {
- return new SimpleBeanMapAdaptor(ApplicationContext.class.getName());
- }
-
-}
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanStore.java (from rev 1661, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanMap.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanStore.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanStore.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.webbeans.servlet;
+
+import java.util.Enumeration;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.webbeans.context.ApplicationContext;
+import org.jboss.webbeans.context.beanstore.AbstractBeanStore;
+import org.jboss.webbeans.context.beanstore.BeanStoreNamingScheme;
+import org.jboss.webbeans.context.beanstore.PrefixBeanStoreNamingScheme;
+
+/**
+ * A BeanStore that uses a servlet context as backing storage
+ *
+ * @author Nicklas Karlsson
+ *
+ * @see org.jboss.webbeans.context.ApplicationContext
+ */
+public class ApplicationBeanStore extends AbstractBeanStore
+{
+ // The servlet context to use as backing map
+ private ServletContext context;
+
+ /**
+ * Constructor
+ *
+ * @param context The servlet context instance
+ */
+ public ApplicationBeanStore(ServletContext context)
+ {
+ super();
+ this.context = context;
+ }
+
+ /**
+ * @see org.jboss.webbeans.context.beanstore.AbstractBeanStore#getAttribute()
+ */
+ @Override
+ protected Object getAttribute(String key)
+ {
+ return context.getAttribute(key);
+ }
+
+ /**
+ * @see org.jboss.webbeans.context.beanstore.AbstractBeanStore#getAttributeNames()
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ protected Enumeration<String> getAttributeNames()
+ {
+ return context.getAttributeNames();
+ }
+
+ /**
+ * @see org.jboss.webbeans.context.beanstore.AbstractBeanStore#removeAttributes()
+ */
+ @Override
+ protected void removeAttribute(String key)
+ {
+ context.removeAttribute(key);
+ }
+
+ /**
+ * @see org.jboss.webbeans.context.beanstore.AbstractBeanStore#setAttribute()
+ */
+ @Override
+ protected void setAttribute(String key, Object instance)
+ {
+ context.setAttribute(key, instance);
+ }
+
+ @Override
+ protected BeanStoreNamingScheme getBeanNamingScheme()
+ {
+ return new PrefixBeanStoreNamingScheme(ApplicationContext.class.getName(), "#");
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ApplicationBeanStore.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ConversationBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ConversationBeanMap.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ConversationBeanMap.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.webbeans.servlet;
-
-import javax.servlet.http.HttpSession;
-
-import org.jboss.webbeans.context.ConversationContext;
-import org.jboss.webbeans.context.beanmap.BeanMapAdaptor;
-import org.jboss.webbeans.context.beanmap.SimpleBeanMapAdaptor;
-
-/**
- * A HTTP session backed bean map for the conversational scope
- *
- * @author Nicklas Karlsson
- */
-public class ConversationBeanMap extends HttpSessionBeanMap
-{
- private String cid;
-
- public ConversationBeanMap(HttpSession session, String cid)
- {
- super(session);
- this.cid = cid;
- }
-
- @Override
- protected BeanMapAdaptor getBeanMapAdaptor()
- {
- return new SimpleBeanMapAdaptor(ConversationContext.class.getName() + "[" + cid + "]");
- }
-
-}
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ConversationBeanStore.java (from rev 1661, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ConversationBeanMap.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ConversationBeanStore.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ConversationBeanStore.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.webbeans.servlet;
+
+import javax.servlet.http.HttpSession;
+
+import org.jboss.webbeans.context.ConversationContext;
+import org.jboss.webbeans.context.beanstore.BeanStoreNamingScheme;
+import org.jboss.webbeans.context.beanstore.PrefixBeanStoreNamingScheme;
+
+/**
+ * A HTTP session backed bean map for the conversational scope
+ *
+ * @author Nicklas Karlsson
+ */
+public class ConversationBeanStore extends HttpSessionBeanStore
+{
+ private String cid;
+
+ public ConversationBeanStore(HttpSession session, String cid)
+ {
+ super(session);
+ this.cid = cid;
+ }
+
+ @Override
+ protected BeanStoreNamingScheme getBeanNamingScheme()
+ {
+ return new PrefixBeanStoreNamingScheme(ConversationContext.class.getName() + "[" + cid + "]", "#");
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ConversationBeanStore.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/HttpSessionBeanMap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/HttpSessionBeanMap.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/HttpSessionBeanMap.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -1,94 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.servlet;
-
-import java.util.Enumeration;
-
-import javax.servlet.http.HttpSession;
-
-import org.jboss.webbeans.context.SessionContext;
-import org.jboss.webbeans.context.beanmap.AbstractBeanMap;
-import org.jboss.webbeans.context.beanmap.BeanMapAdaptor;
-import org.jboss.webbeans.context.beanmap.SimpleBeanMapAdaptor;
-
-/**
- * A BeanMap that uses a HTTP session as backing map
- *
- * @author Nicklas Karlsson
- *
- * @see org.jboss.webbeans.context.ApplicationContext
- */
-public class HttpSessionBeanMap extends AbstractBeanMap
-{
- // The HTTP session context to use as backing map
- private HttpSession session;
-
- /**
- * Constructor
- *
- * @param session The HTTP session
- */
- public HttpSessionBeanMap(HttpSession session)
- {
- super();
- this.session = session;
- }
-
- /**
- * @see org.jboss.webbeans.context.beanmap.AbstractBeanMap#getAttribute()
- */
- @Override
- protected Object getAttribute(String key)
- {
- return session.getAttribute(key);
- }
-
- /**
- * @see org.jboss.webbeans.context.beanmap.AbstractBeanMap#getAttributeNames()
- */
- @SuppressWarnings("unchecked")
- @Override
- protected Enumeration<String> getAttributeNames()
- {
- return session.getAttributeNames();
- }
-
- /**
- * @see org.jboss.webbeans.context.beanmap.AbstractBeanMap#removeAttributes()
- */
- @Override
- protected void removeAttribute(String key)
- {
- session.removeAttribute(key);
- }
-
- /**
- * @see org.jboss.webbeans.context.beanmap.AbstractBeanMap#setAttribute()
- */
- @Override
- protected void setAttribute(String key, Object instance)
- {
- session.setAttribute(key, instance);
- }
-
- @Override
- protected BeanMapAdaptor getBeanMapAdaptor()
- {
- return new SimpleBeanMapAdaptor(SessionContext.class.getName());
- }
-
-}
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/HttpSessionBeanStore.java (from rev 1661, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/HttpSessionBeanMap.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/HttpSessionBeanStore.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/HttpSessionBeanStore.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.servlet;
+
+import java.util.Enumeration;
+
+import javax.servlet.http.HttpSession;
+
+import org.jboss.webbeans.context.SessionContext;
+import org.jboss.webbeans.context.beanstore.AbstractBeanStore;
+import org.jboss.webbeans.context.beanstore.BeanStoreNamingScheme;
+import org.jboss.webbeans.context.beanstore.PrefixBeanStoreNamingScheme;
+
+/**
+ * A BeanStore that uses a HTTP session as backing storage
+ *
+ * @author Nicklas Karlsson
+ *
+ * @see org.jboss.webbeans.context.ApplicationContext
+ */
+public class HttpSessionBeanStore extends AbstractBeanStore
+{
+ // The HTTP session context to use as backing map
+ private HttpSession session;
+
+ /**
+ * Constructor
+ *
+ * @param session The HTTP session
+ */
+ public HttpSessionBeanStore(HttpSession session)
+ {
+ super();
+ this.session = session;
+ }
+
+ /**
+ * @see org.jboss.webbeans.context.beanstore.AbstractBeanStore#getAttribute()
+ */
+ @Override
+ protected Object getAttribute(String key)
+ {
+ return session.getAttribute(key);
+ }
+
+ /**
+ * @see org.jboss.webbeans.context.beanstore.AbstractBeanStore#getAttributeNames()
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ protected Enumeration<String> getAttributeNames()
+ {
+ return session.getAttributeNames();
+ }
+
+ /**
+ * @see org.jboss.webbeans.context.beanstore.AbstractBeanStore#removeAttributes()
+ */
+ @Override
+ protected void removeAttribute(String key)
+ {
+ session.removeAttribute(key);
+ }
+
+ /**
+ * @see org.jboss.webbeans.context.beanstore.AbstractBeanStore#setAttribute()
+ */
+ @Override
+ protected void setAttribute(String key, Object instance)
+ {
+ session.setAttribute(key, instance);
+ }
+
+ @Override
+ protected BeanStoreNamingScheme getBeanNamingScheme()
+ {
+ return new PrefixBeanStoreNamingScheme(SessionContext.class.getName(), "#");
+ }
+
+}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -24,7 +24,7 @@
import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.context.SessionContext;
import org.jboss.webbeans.context.api.BeanStore;
-import org.jboss.webbeans.context.beanmap.SimpleBeanMap;
+import org.jboss.webbeans.context.beanstore.SimpleBeanStore;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -40,7 +40,7 @@
public class ServletLifecycle extends AbstractLifecycle
{
- public static final String REQUEST_ATTRIBUTE_NAME = ServletLifecycle.class.getName() + ".requestBeanMap";
+ public static final String REQUEST_ATTRIBUTE_NAME = ServletLifecycle.class.getName() + ".requestBeanStore";
static
{
@@ -71,11 +71,11 @@
{
ServletInitialization servletInitialization = new ServletInitialization(servletContext).initialize();
super.initialize();
- super.beginApplication(servletContext.getServletContextName(), new ApplicationBeanMap(servletContext));
- BeanStore requestBeanMap = new SimpleBeanMap();
- super.beginDeploy(requestBeanMap);
+ super.beginApplication(servletContext.getServletContextName(), new ApplicationBeanStore(servletContext));
+ BeanStore requestBeanStore = new SimpleBeanStore();
+ super.beginDeploy(requestBeanStore);
servletInitialization.start();
- super.endDeploy(requestBeanMap);
+ super.endDeploy(requestBeanStore);
}
/**
@@ -83,7 +83,7 @@
*/
public void endApplication(ServletContext servletContext)
{
- super.endApplication(servletContext.getServletContextName(), new ApplicationBeanMap(servletContext));
+ super.endApplication(servletContext.getServletContextName(), new ApplicationBeanStore(servletContext));
}
/**
@@ -115,10 +115,10 @@
*/
protected BeanStore restoreSessionContext(HttpSession session)
{
- BeanStore sessionBeanMap = new HttpSessionBeanMap(session);
- SessionContext.INSTANCE.setBeanMap(sessionBeanMap);
+ BeanStore sessionBeanStore = new HttpSessionBeanStore(session);
+ SessionContext.INSTANCE.setBeanStore(sessionBeanStore);
CurrentManager.rootManager().getInstanceByType(HttpSessionManager.class).setSession(session);
- return sessionBeanMap;
+ return sessionBeanStore;
}
/**
@@ -130,7 +130,7 @@
*/
public void beginRequest(HttpServletRequest request)
{
- BeanStore beanStore = new SimpleBeanMap();
+ BeanStore beanStore = new SimpleBeanStore();
request.setAttribute(REQUEST_ATTRIBUTE_NAME, beanStore);
super.beginRequest(request.getRequestURI(), beanStore);
restoreSessionContext(request.getSession());
@@ -146,7 +146,7 @@
BeanStore beanStore = (BeanStore) request.getAttribute(REQUEST_ATTRIBUTE_NAME);
request.removeAttribute(REQUEST_ATTRIBUTE_NAME);
super.endRequest(request.getRequestURI(), beanStore);
- SessionContext.INSTANCE.setBeanMap(null);
+ SessionContext.INSTANCE.setBeanStore(null);
}
/**
@@ -157,7 +157,7 @@
*/
public void restoreConversation(HttpSession session, String cid)
{
- super.restoreConversation(session.getId() + "[" + cid + "]", new ConversationBeanMap(session, cid));
+ super.restoreConversation(session.getId() + "[" + cid + "]", new ConversationBeanStore(session, cid));
}
/**
@@ -168,7 +168,7 @@
*/
public void destroyConversation(HttpSession session, String cid)
{
- super.destroyConversation(session.getId() + "[" + cid + "]", new ConversationBeanMap(session, cid));
+ super.destroyConversation(session.getId() + "[" + cid + "]", new ConversationBeanStore(session, cid));
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle2.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle2.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/ServletLifecycle2.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -24,7 +24,7 @@
import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.context.SessionContext;
import org.jboss.webbeans.context.api.BeanStore;
-import org.jboss.webbeans.context.beanmap.SimpleBeanMap;
+import org.jboss.webbeans.context.beanstore.SimpleBeanStore;
/**
* Implementation of the Web Beans lifecycle that can react to servlet events.
@@ -37,7 +37,7 @@
public class ServletLifecycle2 extends AbstractLifecycle
{
- public static final String REQUEST_ATTRIBUTE_NAME = ServletLifecycle2.class.getName() + ".requestBeanMap";
+ public static final String REQUEST_ATTRIBUTE_NAME = ServletLifecycle2.class.getName() + ".requestBeanStore";
public static ServletLifecycle2 instance()
{
@@ -58,7 +58,7 @@
*/
public void beginApplication(ServletContext servletContext)
{
- super.beginApplication(servletContext.getServletContextName(), new ApplicationBeanMap(servletContext));
+ super.beginApplication(servletContext.getServletContextName(), new ApplicationBeanStore(servletContext));
}
/**
@@ -66,7 +66,7 @@
*/
public void endApplication(ServletContext servletContext)
{
- super.endApplication(servletContext.getServletContextName(), new ApplicationBeanMap(servletContext));
+ super.endApplication(servletContext.getServletContextName(), new ApplicationBeanStore(servletContext));
}
/**
@@ -98,10 +98,10 @@
*/
protected BeanStore restoreSessionContext(HttpSession session)
{
- BeanStore sessionBeanMap = new HttpSessionBeanMap(session);
- SessionContext.INSTANCE.setBeanMap(sessionBeanMap);
+ BeanStore sessionBeanStore = new HttpSessionBeanStore(session);
+ SessionContext.INSTANCE.setBeanStore(sessionBeanStore);
CurrentManager.rootManager().getInstanceByType(HttpSessionManager.class).setSession(session);
- return sessionBeanMap;
+ return sessionBeanStore;
}
/**
@@ -114,7 +114,7 @@
public void beginRequest(HttpServletRequest request)
{
restoreSessionContext(request.getSession());
- BeanStore beanStore = new SimpleBeanMap();
+ BeanStore beanStore = new SimpleBeanStore();
request.setAttribute(REQUEST_ATTRIBUTE_NAME, beanStore);
super.beginRequest(request.getRequestURI(), beanStore);
}
@@ -129,7 +129,7 @@
BeanStore beanStore = (BeanStore) request.getAttribute(REQUEST_ATTRIBUTE_NAME);
request.removeAttribute(REQUEST_ATTRIBUTE_NAME);
super.endRequest(request.getRequestURI(), beanStore);
- SessionContext.INSTANCE.setBeanMap(null);
+ SessionContext.INSTANCE.setBeanStore(null);
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansServletFilter.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansServletFilter.java 2009-02-23 19:43:17 UTC (rev 1661)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/servlet/WebBeansServletFilter.java 2009-02-23 20:50:23 UTC (rev 1662)
@@ -54,18 +54,21 @@
public RedirectUrl appendCid(String cid)
{
- return new RedirectUrl(URL + (URL.indexOf("?") > 0 ? "&" : "?") + "cid=" + cid);
+ URL = URL + (URL.indexOf("?") > 0 ? "&" : "?") + "cid=" + cid;
+ return this;
}
public RedirectUrl getRedirectView()
{
String requestPath = context.getExternalContext().getRequestContextPath();
- return new RedirectUrl(URL.substring(URL.indexOf(requestPath) + requestPath.length()));
+ URL = URL.substring(URL.indexOf(requestPath) + requestPath.length());
+ return this;
}
public RedirectUrl getActionUrl()
{
- return new RedirectUrl(context.getApplication().getViewHandler().getActionURL(context, URL));
+ URL = context.getApplication().getViewHandler().getActionURL(context, URL);
+ return this;
}
public String encode()
@@ -80,7 +83,6 @@
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
{
- System.out.println("!!!");
chain.doFilter(request, wrapResponse((HttpServletResponse) response));
}
More information about the weld-commits
mailing list