You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by st...@apache.org on 2013/04/18 21:35:28 UTC
[2/2] git commit: DELTASPIKE-289 controllable WindowContext
DELTASPIKE-289 controllable WindowContext
Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/32b5ef9d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/32b5ef9d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/32b5ef9d
Branch: refs/heads/master
Commit: 32b5ef9df68ad121ed7bb3f790a36b074d103117
Parents: 9ef7a9c
Author: Mark Struberg <st...@apache.org>
Authored: Thu Apr 18 21:34:09 2013 +0200
Committer: Mark Struberg <st...@apache.org>
Committed: Thu Apr 18 21:34:09 2013 +0200
----------------------------------------------------------------------
.../core/spi/scope/window/WindowContext.java | 2 +-
.../impl/scope/window/DefaultWindowContext.java | 131 --------------
.../scope/window/DeltaSpikeContextExtension.java | 31 +++-
.../core/impl/scope/window/WindowContextImpl.java | 135 +++++++++++++++
.../impl/scope/window/WindowContextProducer.java | 46 +++++
.../core/impl/scope/window/WindowIdHolder.java | 6 +-
.../services/javax.enterprise.inject.spi.Extension | 1 +
.../scope/window/DefaultWindowContextTest.java | 102 +++++++++++
.../impl/scope/window/SomeWindowScopedBean.java | 42 +++++
9 files changed, 360 insertions(+), 136 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/32b5ef9d/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/spi/scope/window/WindowContext.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/spi/scope/window/WindowContext.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/spi/scope/window/WindowContext.java
index b08ede1..fbd585c 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/spi/scope/window/WindowContext.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/spi/scope/window/WindowContext.java
@@ -58,7 +58,7 @@ public interface WindowContext
/**
* Close all WindowContexts which are managed by the WindowContextManager.
- * This is necessary when the session gets closed down.
+ * This is necessary when the session gets closed down or the application closes.
* @return
*/
void destroy();
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/32b5ef9d/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/DefaultWindowContext.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/DefaultWindowContext.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/DefaultWindowContext.java
deleted file mode 100644
index 1d63b2b..0000000
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/DefaultWindowContext.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * 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.deltaspike.core.impl.scope.window;
-
-import javax.enterprise.context.ContextNotActiveException;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.inject.Inject;
-
-import java.lang.annotation.Annotation;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.deltaspike.core.api.scope.WindowScoped;
-import org.apache.deltaspike.core.spi.scope.window.WindowContext;
-import org.apache.deltaspike.core.util.context.AbstractContext;
-import org.apache.deltaspike.core.util.context.ContextualStorage;
-
-/**
- * Context to handle @{@link WindowScoped} beans.
- */
-public class DefaultWindowContext extends AbstractContext implements WindowContext
-{
- /**
- * all the {@link WindowContext}s which are active in this very Session.
- */
- private Map<String, WindowContext> windowContexts = new ConcurrentHashMap<String, WindowContext>();
-
- @Inject
- private WindowIdHolder windowIdHolder;
-
- @Inject
- private WindowBeanHolder windowBeanHolder;
-
- private BeanManager beanManager;
-
-
- public DefaultWindowContext(BeanManager beanManager)
- {
- super(beanManager);
-
- this.beanManager = beanManager;
- }
-
- @Override
- public void activateWindowContext(String windowId)
- {
- windowIdHolder.setWindowId(windowId);
- }
-
- @Override
- public String getCurrentWindowId()
- {
- return windowIdHolder.getWindowId();
- }
-
- @Override
- public boolean closeCurrentWindowContext()
- {
- String windowId = windowIdHolder.getWindowId();
- if (windowId == null)
- {
- return false;
- }
-
- WindowContext windowContext = windowContexts.get(windowId);
- if (windowContext == null)
- {
- return false;
- }
-
- return true;
- }
-
- @Override
- public synchronized void destroy()
- {
- // we replace the old windowBeanHolder beans with a new storage Map
- // an afterwards destroy the old Beans without having to care about any syncs.
- Map<String, ContextualStorage> oldWindowContextStorages = windowBeanHolder.forceNewStorage();
-
- for (ContextualStorage contextualStorage : oldWindowContextStorages.values())
- {
- destroyAllActive(contextualStorage);
- }
- }
-
- @Override
- protected ContextualStorage getContextualStorage(boolean createIfNotExist)
- {
- String windowId = getCurrentWindowId();
- if (windowId == null)
- {
- throw new ContextNotActiveException("WindowContext: no windowId set for the current Thread yet!");
- }
-
- return windowBeanHolder.getContextualStorage(beanManager, windowId);
- }
-
- @Override
- public Class<? extends Annotation> getScope()
- {
- return WindowScoped.class;
- }
-
- /**
- * The WindowContext is active once a current windowId is set for the current Thread.
- * @return
- */
- @Override
- public boolean isActive()
- {
- String windowId = getCurrentWindowId();
- return windowId != null;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/32b5ef9d/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/DeltaSpikeContextExtension.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/DeltaSpikeContextExtension.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/DeltaSpikeContextExtension.java
index 9f03783..ad8186e 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/DeltaSpikeContextExtension.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/DeltaSpikeContextExtension.java
@@ -20,19 +20,44 @@ package org.apache.deltaspike.core.impl.scope.window;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
+import javax.enterprise.inject.spi.AfterDeploymentValidation;
import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.Extension;
+
+import org.apache.deltaspike.core.api.provider.BeanProvider;
/**
* Handle all DeltaSpike WindowContext and ConversationContext
* related features.
*/
-public class DeltaSpikeContextExtension
+public class DeltaSpikeContextExtension implements Extension
{
- private DefaultWindowContext windowContext;
+ private WindowContextImpl windowContext;
public void registerDeltaSpikeContexts(@Observes AfterBeanDiscovery afterBeanDiscovery, BeanManager beanManager)
{
- windowContext = new DefaultWindowContext(beanManager);
+ windowContext = new WindowContextImpl(beanManager);
afterBeanDiscovery.addContext(windowContext);
}
+
+ /**
+ * We can only initialize our contexts in AfterDeploymentValidation because
+ * getBeans must not be invoked earlier than this phase to reduce randomness
+ * caused by Beans no being fully registered yet.
+ */
+ public void initializeDeltaSpikeContexts(@Observes AfterDeploymentValidation adv, BeanManager beanManager)
+ {
+ WindowBeanHolder windowBeanHolder
+ = BeanProvider.getContextualReference(beanManager, WindowBeanHolder.class, false);
+
+ WindowIdHolder windowIdHolder
+ = BeanProvider.getContextualReference(beanManager, WindowIdHolder.class, false);
+
+ windowContext.initWindowContext(windowBeanHolder, windowIdHolder);
+ }
+
+ public WindowContextImpl getWindowContext()
+ {
+ return windowContext;
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/32b5ef9d/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/WindowContextImpl.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/WindowContextImpl.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/WindowContextImpl.java
new file mode 100644
index 0000000..f20d02f
--- /dev/null
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/WindowContextImpl.java
@@ -0,0 +1,135 @@
+/*
+ * 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.deltaspike.core.impl.scope.window;
+
+import javax.enterprise.context.ContextNotActiveException;
+import javax.enterprise.inject.Typed;
+import javax.enterprise.inject.spi.BeanManager;
+
+import java.lang.annotation.Annotation;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.deltaspike.core.api.scope.WindowScoped;
+import org.apache.deltaspike.core.spi.scope.window.WindowContext;
+import org.apache.deltaspike.core.util.context.AbstractContext;
+import org.apache.deltaspike.core.util.context.ContextualStorage;
+
+/**
+ * Context to handle @{@link WindowScoped} beans.
+ */
+@Typed()
+public class WindowContextImpl extends AbstractContext implements WindowContext
+{
+ /**
+ * all the {@link WindowContext}s which are active in this very Session.
+ */
+ private Map<String, WindowContext> windowContexts = new ConcurrentHashMap<String, WindowContext>();
+
+ private WindowIdHolder windowIdHolder;
+ private WindowBeanHolder windowBeanHolder;
+
+ private BeanManager beanManager;
+
+
+ public WindowContextImpl(BeanManager beanManager)
+ {
+ super(beanManager);
+
+ this.beanManager = beanManager;
+ }
+
+ @Override
+ public void activateWindowContext(String windowId)
+ {
+ windowIdHolder.setWindowId(windowId);
+ }
+
+ @Override
+ public String getCurrentWindowId()
+ {
+ return windowIdHolder.getWindowId();
+ }
+
+ @Override
+ public boolean closeCurrentWindowContext()
+ {
+ String windowId = windowIdHolder.getWindowId();
+ if (windowId == null)
+ {
+ return false;
+ }
+
+ WindowContext windowContext = windowContexts.get(windowId);
+ if (windowContext == null)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public synchronized void destroy()
+ {
+ // we replace the old windowBeanHolder beans with a new storage Map
+ // an afterwards destroy the old Beans without having to care about any syncs.
+ Map<String, ContextualStorage> oldWindowContextStorages = windowBeanHolder.forceNewStorage();
+
+ for (ContextualStorage contextualStorage : oldWindowContextStorages.values())
+ {
+ destroyAllActive(contextualStorage);
+ }
+ }
+
+ @Override
+ protected ContextualStorage getContextualStorage(boolean createIfNotExist)
+ {
+ String windowId = getCurrentWindowId();
+ if (windowId == null)
+ {
+ throw new ContextNotActiveException("WindowContext: no windowId set for the current Thread yet!");
+ }
+
+ return windowBeanHolder.getContextualStorage(beanManager, windowId);
+ }
+
+ @Override
+ public Class<? extends Annotation> getScope()
+ {
+ return WindowScoped.class;
+ }
+
+ /**
+ * The WindowContext is active once a current windowId is set for the current Thread.
+ * @return
+ */
+ @Override
+ public boolean isActive()
+ {
+ String windowId = getCurrentWindowId();
+ return windowId != null;
+ }
+
+ void initWindowContext(WindowBeanHolder windowBeanHolder, WindowIdHolder windowIdHolder)
+ {
+ this.windowBeanHolder = windowBeanHolder;
+ this.windowIdHolder = windowIdHolder;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/32b5ef9d/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/WindowContextProducer.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/WindowContextProducer.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/WindowContextProducer.java
new file mode 100644
index 0000000..54ca5cb
--- /dev/null
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/WindowContextProducer.java
@@ -0,0 +1,46 @@
+/*
+ * 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.deltaspike.core.impl.scope.window;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.Dependent;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+import org.apache.deltaspike.core.spi.scope.window.WindowContext;
+
+/**
+ * This producer provides access to the internally created
+ * {@link WindowContext} implementation.
+ * It simply wraps through to the instance used in the
+ * {@link DeltaSpikeContextExtension}.
+ */
+@ApplicationScoped
+public class WindowContextProducer
+{
+ @Inject
+ private DeltaSpikeContextExtension deltaSpikeContextExtension;
+
+ @Produces
+ @Dependent
+ public WindowContext getWindowContext()
+ {
+ return deltaSpikeContextExtension.getWindowContext();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/32b5ef9d/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/WindowIdHolder.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/WindowIdHolder.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/WindowIdHolder.java
index f318c1b..519d77e 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/WindowIdHolder.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/scope/window/WindowIdHolder.java
@@ -21,7 +21,11 @@ package org.apache.deltaspike.core.impl.scope.window;
import javax.enterprise.context.RequestScoped;
/**
- * Simple class which just provides a @RequestScoped windowId.
+ * Simple class which just provides a @RequestScoped windowId.
+ * This assures that there is maximum one single windowId associated
+ * with a single Thread or Request. We use @RequestScoped because
+ * this also works in async-supported Servlets without having to
+ * take care about moving info between ThreadLocals.
*/
@RequestScoped
public class WindowIdHolder
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/32b5ef9d/deltaspike/core/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/deltaspike/core/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
index b58a69f..666a6b6 100644
--- a/deltaspike/core/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
+++ b/deltaspike/core/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
@@ -22,3 +22,4 @@ org.apache.deltaspike.core.impl.message.MessageBundleExtension
org.apache.deltaspike.core.impl.exception.control.extension.ExceptionControlExtension
org.apache.deltaspike.core.impl.config.ConfigurationExtension
org.apache.deltaspike.core.impl.jmx.MBeanExtension
+org.apache.deltaspike.core.impl.scope.window.DeltaSpikeContextExtension
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/32b5ef9d/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/scope/window/DefaultWindowContextTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/scope/window/DefaultWindowContextTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/scope/window/DefaultWindowContextTest.java
new file mode 100644
index 0000000..68408fd
--- /dev/null
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/scope/window/DefaultWindowContextTest.java
@@ -0,0 +1,102 @@
+/*
+ * 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.deltaspike.test.core.impl.scope.window;
+
+import javax.inject.Inject;
+
+import org.apache.deltaspike.core.spi.scope.window.WindowContext;
+import org.apache.deltaspike.test.category.SeCategory;
+import org.apache.deltaspike.test.util.ArchiveUtils;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import org.junit.Assert;
+
+@RunWith(Arquillian.class)
+@Category(SeCategory.class)
+public class DefaultWindowContextTest
+{
+ @Deployment
+ public static WebArchive deploy()
+ {
+ JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "defaultWindowContextTest.jar")
+ .addPackage(DefaultWindowContextTest.class.getPackage().getName())
+ .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
+
+ return ShrinkWrap.create(WebArchive.class, "defaultWindowContextTest.war")
+ .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive())
+ .addAsLibraries(testJar)
+ .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
+ }
+
+
+ @Inject
+ private WindowContext windowContext;
+
+ @Inject
+ private SomeWindowScopedBean someWindowScopedBean;
+
+ /**
+ * Tests {@link org.apache.deltaspike.core.impl.util.JndiUtils#lookup(String, Class)} by looking up the {@link javax.enterprise.inject.spi.BeanManager}
+ */
+ @Test
+ public void testWindowScoedBean()
+ {
+ Assert.assertNotNull(windowContext);
+ Assert.assertNotNull(someWindowScopedBean);
+
+ {
+ windowContext.activateWindowContext("window1");
+ someWindowScopedBean.setValue("Hans");
+ Assert.assertEquals("Hans", someWindowScopedBean.getValue());
+ }
+
+ // now we switch it away to another 'window'
+ {
+ windowContext.activateWindowContext("window2");
+ Assert.assertNull(someWindowScopedBean.getValue());
+ someWindowScopedBean.setValue("Karl");
+ Assert.assertEquals("Karl", someWindowScopedBean.getValue());
+ }
+
+ // and now back to the first window
+ {
+ windowContext.activateWindowContext("window1");
+
+ // which must still contain the old value
+ Assert.assertEquals("Hans", someWindowScopedBean.getValue());
+ }
+
+ // and again back to the second window
+ {
+ windowContext.activateWindowContext("window2");
+
+ // which must still contain the old value of the 2nd window
+ Assert.assertEquals("Karl", someWindowScopedBean.getValue());
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/32b5ef9d/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/scope/window/SomeWindowScopedBean.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/scope/window/SomeWindowScopedBean.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/scope/window/SomeWindowScopedBean.java
new file mode 100644
index 0000000..368f62c
--- /dev/null
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/scope/window/SomeWindowScopedBean.java
@@ -0,0 +1,42 @@
+/*
+ * 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.deltaspike.test.core.impl.scope.window;
+
+import java.io.Serializable;
+
+import org.apache.deltaspike.core.api.scope.WindowScoped;
+
+/**
+ * example bean for @WindowScoped
+ */
+@WindowScoped
+public class SomeWindowScopedBean implements Serializable
+{
+ private String value;
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+}