http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestAppScope.java ---------------------------------------------------------------------- diff --git a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestAppScope.java b/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestAppScope.java deleted file mode 100644 index b36f8a7..0000000 --- a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestAppScope.java +++ /dev/null @@ -1,40 +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.wicket.cdi.testapp; - -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.inject.Produces; - -/** - * @author jsarman - */ -@ApplicationScoped -public class TestAppScope -{ - - public String test() - { - return "Test ok"; - } - - public @Produces - @TestQualifier - String testString() - { - return "Test String"; - } -}
http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestApplication.java ---------------------------------------------------------------------- diff --git a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestApplication.java b/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestApplication.java deleted file mode 100644 index 7b82203..0000000 --- a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestApplication.java +++ /dev/null @@ -1,39 +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.wicket.cdi.testapp; - -import org.apache.wicket.Page; -import org.apache.wicket.protocol.http.WebApplication; - -/** - * @author jsarman - */ -public class TestApplication extends WebApplication -{ - - @Override - public Class<? extends Page> getHomePage() - { - return TestPage.class; - } - - @Override - protected void init() - { - super.init(); - } -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestCdiApplication.java ---------------------------------------------------------------------- diff --git a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestCdiApplication.java b/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestCdiApplication.java deleted file mode 100644 index 1bd8656..0000000 --- a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestCdiApplication.java +++ /dev/null @@ -1,54 +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.wicket.cdi.testapp; - -import javax.inject.Inject; - -import org.apache.wicket.Page; -import org.apache.wicket.cdi.CdiConfiguration; -import org.apache.wicket.protocol.http.WebApplication; - -/** - * @author jsarman - */ -public class TestCdiApplication extends WebApplication -{ - - @Inject - @TestQualifier - String testString; - - - @Override - public Class<? extends Page> getHomePage() - { - return TestPage.class; - } - - @Override - protected void init() - { - super.init(); - new CdiConfiguration().configure(this); - } - - public String getInjectedTestString() - { - return testString; - } - -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationBean.java ---------------------------------------------------------------------- diff --git a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationBean.java b/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationBean.java deleted file mode 100644 index 140ecdb..0000000 --- a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationBean.java +++ /dev/null @@ -1,56 +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.wicket.cdi.testapp; - -import java.io.Serializable; -import java.util.concurrent.atomic.AtomicInteger; - -import javax.enterprise.context.ConversationScoped; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author jsarman - */ -@ConversationScoped -public class TestConversationBean implements Serializable -{ - private static final long serialVersionUID = 1L; - - private static final Logger logger = LoggerFactory.getLogger(TestConversationBean.class); - - private AtomicInteger counter = new AtomicInteger(); - - public int getCount() - { - logger.debug("Count = {}", counter.get()); - return counter.get(); - } - - public String getCountStr() - { - return "COUNT=x" + getCount() + "x"; - } - - public void increment() - { - - counter.incrementAndGet(); - - } -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.html ---------------------------------------------------------------------- diff --git a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.html b/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.html deleted file mode 100644 index e7f3de7..0000000 --- a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.html +++ /dev/null @@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html xmlns:wicket> -<head> - <title></title> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -</head> -<body> -<span wicket:id="count">100</span> -<a wicket:id="increment">increment</a> -<a wicket:id="next">Reset</a> -</body> -</html> http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.java ---------------------------------------------------------------------- diff --git a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.java b/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.java deleted file mode 100644 index c6cc8bc..0000000 --- a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationPage.java +++ /dev/null @@ -1,84 +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.wicket.cdi.testapp; - -import javax.enterprise.context.Conversation; -import javax.inject.Inject; - -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.model.PropertyModel; -import org.apache.wicket.request.mapper.parameter.PageParameters; - - -/** - * @author jsarman - */ -public class TestConversationPage extends WebPage -{ - private static final long serialVersionUID = 1L; - - @Inject - Conversation conversation; - - @Inject - TestConversationBean counter; - - public TestConversationPage() - { - this(new PageParameters()); - } - - public TestConversationPage(final PageParameters parameters) - { - super(parameters); - - conversation.begin(); - System.out.println("Opened Conversion with id = " + conversation.getId()); - - add(new Label("count", new PropertyModel<String>(this, "counter.countStr"))); - - add(new Link<Void>("increment") - { - private static final long serialVersionUID = 1L; - - @Override - public void onClick() - { - counter.increment(); - } - }); - add(new Link<Void>("next") - { - private static final long serialVersionUID = 1L; - - @Override - public void onClick() - { - String pageType = parameters.get("pageType").toString("nonbookmarkable"); - if ("bookmarkable".equals(pageType.toLowerCase())) - setResponsePage(TestNonConversationalPage.class); - else if ("hybrid".equals(pageType.toLowerCase())) - setResponsePage(TestConversationPage.this); - else - setResponsePage(new TestNonConversationalPage()); - } - }); - - } -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationalPage.html ---------------------------------------------------------------------- diff --git a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationalPage.html b/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationalPage.html deleted file mode 100644 index b3550f1..0000000 --- a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationalPage.html +++ /dev/null @@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html xmlns:wicket> -<head> - <title></title> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -</head> -<body> -<span wicket:id="count">100</span> -<a wicket:id="increment">increment</a> -<a wicket:id="next">next</a> -</body> -</html> http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationalPage.java ---------------------------------------------------------------------- diff --git a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationalPage.java b/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationalPage.java deleted file mode 100644 index 5e41fd5..0000000 --- a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestConversationalPage.java +++ /dev/null @@ -1,78 +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.wicket.cdi.testapp; - -import javax.inject.Inject; - -import org.apache.wicket.cdi.ConversationalComponent; -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.model.PropertyModel; -import org.apache.wicket.request.mapper.parameter.PageParameters; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author jsarman - */ -public class TestConversationalPage extends WebPage implements ConversationalComponent -{ - private static final long serialVersionUID = 1L; - - private static final Logger logger = LoggerFactory.getLogger(TestConversationPage.class); - @Inject - TestConversationBean counter; - - public TestConversationalPage() - { - this(new PageParameters()); - } - - - public TestConversationalPage(final PageParameters pp) - { - logger.debug("Starting TestConversationalPage"); - - add(new Label("count", new PropertyModel<String>(this, "counter.countStr"))); - - add(new Link<Void>("increment") - { - private static final long serialVersionUID = 1L; - - @Override - public void onClick() - { - counter.increment(); - } - }); - add(new Link<Void>("next") - { - private static final long serialVersionUID = 1L; - - @Override - public void onClick() - { - String pageType = pp.get("pageType").toString("nonbookmarkable"); - if ("bookmarkable".equals(pageType.toLowerCase())) - setResponsePage(TestNonConversationalPage.class); - else - setResponsePage(new TestNonConversationalPage()); - } - }); - } -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestNonConversationalPage.html ---------------------------------------------------------------------- diff --git a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestNonConversationalPage.html b/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestNonConversationalPage.html deleted file mode 100644 index fd58f2d..0000000 --- a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestNonConversationalPage.html +++ /dev/null @@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html xmlns:wicket> -<head> - <title></title> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -</head> -<body> -<span wicket:id="count">100</span> -<a wicket:id="increment">increment</a> -</body> -</html> http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestNonConversationalPage.java ---------------------------------------------------------------------- diff --git a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestNonConversationalPage.java b/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestNonConversationalPage.java deleted file mode 100644 index 7728e81..0000000 --- a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestNonConversationalPage.java +++ /dev/null @@ -1,55 +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.wicket.cdi.testapp; - -import javax.inject.Inject; - -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.model.PropertyModel; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * @author jsarman - */ -public class TestNonConversationalPage extends WebPage -{ - private static final long serialVersionUID = 1L; - private static final Logger logger = LoggerFactory.getLogger(TestConversationPage.class); - @Inject - TestConversationBean counter; - - public TestNonConversationalPage() - { - logger.debug("Starting TestConversationalPage"); - add(new Label("count", new PropertyModel<String>(this, "counter.countStr"))); - - add(new Link<Void>("increment") - { - private static final long serialVersionUID = 1L; - - @Override - public void onClick() - { - counter.increment(); - } - }); - } -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestPage.html ---------------------------------------------------------------------- diff --git a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestPage.html b/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestPage.html deleted file mode 100644 index 4689c49..0000000 --- a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestPage.html +++ /dev/null @@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html xmlns:wicket> -<head> - <title></title> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -</head> -<body> -<div wicket:id="appscope">Fail</div> -</body> -</html> http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestPage.java ---------------------------------------------------------------------- diff --git a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestPage.java b/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestPage.java deleted file mode 100644 index cf5108b..0000000 --- a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestPage.java +++ /dev/null @@ -1,40 +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.wicket.cdi.testapp; - -import javax.inject.Inject; - -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.markup.html.basic.Label; - -/** - * @author jsarman - */ -public class TestPage extends WebPage -{ - private static final long serialVersionUID = 1L; - - @Inject - TestAppScope appScope; - - public TestPage() - { - - add(new Label("appscope", appScope.test())); - } - -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestQualifier.java ---------------------------------------------------------------------- diff --git a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestQualifier.java b/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestQualifier.java deleted file mode 100644 index dcd0289..0000000 --- a/wicket-cdi-1.1/src/test/java/org/apache/wicket/cdi/testapp/TestQualifier.java +++ /dev/null @@ -1,35 +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.wicket.cdi.testapp; - - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import javax.inject.Qualifier; - -/** - * @author jsarman - */ -@Qualifier -@Target({ ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD }) -@Retention(RetentionPolicy.RUNTIME) -public @interface TestQualifier { - -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-cdi-1.1/src/test/java/simplelogger.properties ---------------------------------------------------------------------- diff --git a/wicket-cdi-1.1/src/test/java/simplelogger.properties b/wicket-cdi-1.1/src/test/java/simplelogger.properties deleted file mode 100644 index 17c5fe6..0000000 --- a/wicket-cdi-1.1/src/test/java/simplelogger.properties +++ /dev/null @@ -1 +0,0 @@ -org.slf4j.simpleLogger.log.org.apache.wicket.cdi=info \ No newline at end of file http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/pom.xml ---------------------------------------------------------------------- diff --git a/wicket-examples/pom.xml b/wicket-examples/pom.xml index 550a5f4..418898f 100644 --- a/wicket-examples/pom.xml +++ b/wicket-examples/pom.xml @@ -128,10 +128,6 @@ </dependency> <dependency> <groupId>org.apache.wicket</groupId> - <artifactId>wicket-cdi-1.1</artifactId> - </dependency> - <dependency> - <groupId>org.apache.wicket</groupId> <artifactId>wicket-core</artifactId> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ApplicationCounter.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ApplicationCounter.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ApplicationCounter.java deleted file mode 100644 index de1177a..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ApplicationCounter.java +++ /dev/null @@ -1,36 +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.wicket.examples.cdi; - -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.event.Observes; - -import org.apache.wicket.cdi.DetachEvent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -@ApplicationScoped -public class ApplicationCounter extends Counter -{ - private static final Logger logger = LoggerFactory.getLogger(ApplicationCounter.class); - - private void onDetach(@Observes DetachEvent detach) - { - logger.info("Detaching application counter"); - } -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.html b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.html deleted file mode 100644 index 5768bab..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.html +++ /dev/null @@ -1,19 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org"> -<body> -<wicket:extend> - <p> - This page demonstrates automatic conversation managed. Below is a counter - that is conversation-scoped. Click increment a couple of times and then click - the 'Continue to next page', the counter value should persist on the - next page. - </p> - <p> - Current counter value is: <span wicket:id="count">100</span> - <a wicket:id="increment">increment</a> - </p> - <p> - <a wicket:id="next">Continue to next page</a> - </p> -</wicket:extend> -</body> -</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.java deleted file mode 100644 index 1522c8d..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage1.java +++ /dev/null @@ -1,53 +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.wicket.examples.cdi; - -import javax.enterprise.context.Conversation; -import javax.inject.Inject; - -import org.apache.wicket.cdi.ConversationalComponent; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.model.PropertyModel; - -public class AutoConversationPage1 extends CdiExamplePage implements ConversationalComponent -{ - @Inject - ConversationCounter counter; - - @Inject - Conversation conversation; - - public AutoConversationPage1() - { - add(new Label("count", new PropertyModel<Integer>(this, "counter.count"))); - - add(new Link<Void>("increment") { - @Override - public void onClick() - { - counter.increment(); - } - }); - - add(new Link<Void>("next") { - public void onClick() { - setResponsePage(new AutoConversationPage2()); - } - }); - } -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.html b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.html deleted file mode 100644 index 1e1a9ef..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.html +++ /dev/null @@ -1,17 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org"> -<body> -<wicket:extend> - <p> - This page is not marked with ConversationalComponent. Therefore, the conversation that was - started on the previous page is ended. Notice the conversational counter injected into this - page initially has the same value as in the previous page, this is because the conversation - was still active in the request that rendered this page. However, clicking 'refresh' below, - will reset the counter to 0. - </p> - <p> - Current counter value is: <span wicket:id="count">100</span> - <a wicket:id="refresh">refresh</a> - </p> -</wicket:extend> -</body> -</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.java deleted file mode 100644 index 66ac160..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/AutoConversationPage2.java +++ /dev/null @@ -1,42 +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.wicket.examples.cdi; - -import javax.inject.Inject; - -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.model.PropertyModel; - -public class AutoConversationPage2 extends CdiExamplePage -{ - @Inject - ConversationCounter counter; - - public AutoConversationPage2() - { - add(new Label("count", new PropertyModel(this, "counter.count"))); - - add(new Link<Void>("refresh") - { - @Override - public void onClick() - { - } - }); - } -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java deleted file mode 100644 index 1d2111a..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiApplication.java +++ /dev/null @@ -1,45 +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.wicket.examples.cdi; - -import org.apache.wicket.Page; -import org.apache.wicket.cdi.CdiConfiguration; -import org.apache.wicket.protocol.http.WebApplication; - -public class CdiApplication extends WebApplication -{ - - @Override - public Class<? extends Page> getHomePage() - { - return CdiHomePage.class; - } - - @Override - protected void init() - { - super.init(); - - // configure wicket/cdi - new CdiConfiguration().configure(this); - - mountPage("injection", InjectionPage.class); - mountPage("conversation", ConversationPage1.class); - mountPage("autoConversation", AutoConversationPage1.class); - } - -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiExamplePage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiExamplePage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiExamplePage.html deleted file mode 100644 index 7ac00b5..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiExamplePage.html +++ /dev/null @@ -1,18 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:wicket="http://wicket.apache.org" xml:lang="en" lang="en"> - <head> - <title>Wicket Examples - Context, Dependencies, and Injection Integration</title> - </head> - <body> - <wicket:extend> - - <h2>Welcome to Context, Dependencies, and Injection Integration Examples</h2> - - <p><wicket:link><a href="CdiHomePage.html">[go back]</a></wicket:link></p> - - <wicket:child/> - </wicket:extend> -</body> -</html> http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiExamplePage.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiExamplePage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiExamplePage.java deleted file mode 100644 index 5e7c26f..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiExamplePage.java +++ /dev/null @@ -1,24 +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.wicket.examples.cdi; - -import org.apache.wicket.examples.WicketExamplePage; - -public abstract class CdiExamplePage extends WicketExamplePage -{ - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiHomePage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiHomePage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiHomePage.html deleted file mode 100644 index d750a11..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiHomePage.html +++ /dev/null @@ -1,19 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org"> -<body> -<wicket:extend> - <wicket:link> - <ul> - <li> - <a href="InjectionPage.html">Injection Example</a> - </li> - <li> - <a href="ConversationPage1.html">Conversation Propagation Example</a> - </li> - <li> - <a href="AutoConversationPage1.html">Automatic Conversation Management Example</a> - </li> - </ul> - </wicket:link> -</wicket:extend> -</body> -</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiHomePage.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiHomePage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiHomePage.java deleted file mode 100644 index 40f928b..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/CdiHomePage.java +++ /dev/null @@ -1,25 +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.wicket.examples.cdi; - - -public class CdiHomePage extends CdiExamplePage -{ - public CdiHomePage() - { - } -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationCounter.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationCounter.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationCounter.java deleted file mode 100644 index 14ff06f..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationCounter.java +++ /dev/null @@ -1,36 +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.wicket.examples.cdi; - -import javax.enterprise.context.ConversationScoped; -import javax.enterprise.event.Observes; -import javax.enterprise.event.Reception; - -import org.apache.wicket.cdi.DetachEvent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@ConversationScoped -public class ConversationCounter extends Counter -{ - private static final Logger logger = LoggerFactory.getLogger(ConversationCounter.class); - - void onDetach(@Observes(notifyObserver = Reception.IF_EXISTS) DetachEvent detach) - { - logger.info("Detaching conversational counter"); - } -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage1.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage1.html b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage1.html deleted file mode 100644 index ab098bd..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage1.html +++ /dev/null @@ -1,20 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org"> -<body> -<wicket:extend> - <p> - This page demonstrates conversational propagation between - non-bookmarkable pages. Below is a counter that is - conversation-scoped. Click increment a couple of times and then click - the 'Continue to next page', the counter value should persist on the - next page. - </p> - <p> - Current counter value is: <span wicket:id="count">100</span> - <a wicket:id="increment">increment</a> - </p> - <p> - <a wicket:id="next">Continue to next page</a> - </p> -</wicket:extend> -</body> -</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage1.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage1.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage1.java deleted file mode 100644 index 55e0440..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage1.java +++ /dev/null @@ -1,55 +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.wicket.examples.cdi; - -import javax.enterprise.context.Conversation; -import javax.inject.Inject; - -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.model.PropertyModel; - -public class ConversationPage1 extends CdiExamplePage -{ - @Inject - ConversationCounter counter; - - @Inject - Conversation conversation; - - public ConversationPage1() - { - // make the conversation long running - conversation.begin(); - - add(new Label("count", new PropertyModel<Integer>(this, "counter.count"))); - - add(new Link<Void>("increment") { - @Override - public void onClick() - { - counter.increment(); - } - }); - - add(new Link<Void>("next") { - public void onClick() { - setResponsePage(new ConversationPage2()); - } - }); - } -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage2.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage2.html b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage2.html deleted file mode 100644 index f6739f3..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage2.html +++ /dev/null @@ -1,22 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org"> -<body> -<wicket:extend> - <p> - This page was reached via a non-bookmarkable link so conversation was propagated. - Notice the conversational counter injected into this page has the same value as in the - previous page, this is because it is the same counter instance. - </p> - <p> - The 'Continue to next page' link below is a bookmarkable link. Conversations do not propagate - across bookmarkable links, so the counter on the next page will have the starting value of zero. - </p> - <p> - Current counter value is: <span wicket:id="count">100</span> - <a wicket:id="increment">increment</a> - </p> - <p> - <a wicket:id="next">Continue to next page</a> - </p> -</wicket:extend> -</body> -</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage2.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage2.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage2.java deleted file mode 100644 index de34eea..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage2.java +++ /dev/null @@ -1,43 +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.wicket.examples.cdi; - -import javax.inject.Inject; - -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.link.BookmarkablePageLink; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.model.PropertyModel; - -public class ConversationPage2 extends CdiExamplePage -{ - @Inject - ConversationCounter counter; - - public ConversationPage2() - { - add(new Label("count", new PropertyModel<Integer>(this, "counter.count"))); - - add(new Link<Void>("increment") { - public void onClick() { - counter.increment(); - } - }); - - add(new BookmarkablePageLink<Void>("next", ConversationPage3.class)); - } -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage3.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage3.html b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage3.html deleted file mode 100644 index 4d5b32a..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage3.html +++ /dev/null @@ -1,13 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org"> -<body> -<wicket:extend> - <p> - This page was reached via a bookmarkable link, which means the conversation - was not propagated. This is why the counter has a fresh value of zero. - </p> - <p> - Current counter value is: <span wicket:id="count">100</span> - </p> -</wicket:extend> -</body> -</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage3.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage3.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage3.java deleted file mode 100644 index 257d52e..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/ConversationPage3.java +++ /dev/null @@ -1,33 +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.wicket.examples.cdi; - -import javax.inject.Inject; - -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.model.PropertyModel; - -public class ConversationPage3 extends CdiExamplePage -{ - @Inject - ConversationCounter counter; - - public ConversationPage3() - { - add(new Label("count", new PropertyModel(this, "counter.count"))); - } -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/Counter.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/Counter.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/Counter.java deleted file mode 100644 index 32e6fa6..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/Counter.java +++ /dev/null @@ -1,35 +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.wicket.examples.cdi; - -import java.io.Serializable; -import java.util.concurrent.atomic.AtomicInteger; - -public abstract class Counter implements Serializable -{ - private final AtomicInteger counter = new AtomicInteger(); - - public int getCount() - { - return counter.get(); - } - - public void increment() - { - counter.incrementAndGet(); - } -} http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/InjectionPage.html ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/InjectionPage.html b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/InjectionPage.html deleted file mode 100644 index 459ee2e..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/InjectionPage.html +++ /dev/null @@ -1,16 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org"> -<body> -<wicket:extend> -<p> - This page demonstrates injection of a application-scoped Counter service -</p> -<p> - Current counter value is: <span wicket:id="count">100</span> - <a wicket:id="increment">increment</a> -</p> -<p> - Notice as you navigate away and come back to this page the value persists or is larger because it is shared across all users in application scope -</p> -</wicket:extend> -</body> -</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/wicket/blob/9578a8a1/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/InjectionPage.java ---------------------------------------------------------------------- diff --git a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/InjectionPage.java b/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/InjectionPage.java deleted file mode 100644 index 85d85c9..0000000 --- a/wicket-examples/src/main/java/org/apache/wicket/examples/cdi/InjectionPage.java +++ /dev/null @@ -1,40 +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.wicket.examples.cdi; - -import javax.inject.Inject; - -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.link.Link; -import org.apache.wicket.model.PropertyModel; - -public class InjectionPage extends CdiExamplePage -{ - @Inject - ApplicationCounter counter; - - public InjectionPage() - { - add(new Label("count", new PropertyModel<Integer>(this, "counter.count"))); - - add(new Link<Void>("increment") { - public void onClick() { - counter.increment(); - } - }); - } -}
