Skip to content

Commit a7a6a69

Browse files
author
Arun Gupta
committed
CDI extension impl project
1 parent 5df3d3b commit a7a6a69

File tree

6 files changed

+199
-0
lines changed

6 files changed

+199
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project-shared-configuration>
3+
<!--
4+
This file contains additional configuration written by modules in the NetBeans IDE.
5+
The configuration is intended to be shared among all the users of project and
6+
therefore it is assumed to be part of version control checkout.
7+
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
8+
-->
9+
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
10+
<!--
11+
Properties that influence various parts of the IDE, especially code formatting and the like.
12+
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
13+
That way multiple projects can share the same settings (useful for formatting rules for example).
14+
Any value defined here will override the pom.xml file value but is only applicable to the current project.
15+
-->
16+
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>gfv3ee6</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
17+
</properties>
18+
</project-shared-configuration>

cdi/extension-impl/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>org.javaee7.cdi</groupId>
6+
<artifactId>cdi-samples</artifactId>
7+
<version>1.0-SNAPSHOT</version>
8+
<relativePath>../pom.xml</relativePath>
9+
</parent>
10+
11+
<groupId>org.javaee7.cdi</groupId>
12+
<artifactId>extension-impl</artifactId>
13+
<version>1.0-SNAPSHOT</version>
14+
<packaging>jar</packaging>
15+
</project>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
40+
package org.javaee7.cdi.extension.impl;
41+
42+
import java.util.logging.Level;
43+
import java.util.logging.Logger;
44+
import javax.enterprise.event.Observes;
45+
import javax.enterprise.inject.spi.Extension;
46+
import javax.enterprise.inject.spi.ProcessAnnotatedType;
47+
48+
/**
49+
* @author Arun Gupta
50+
*/
51+
public class MyExtension implements Extension {
52+
53+
<T> void processAnnotatedType(@Observes ProcessAnnotatedType<T> pat) {
54+
Logger.getAnonymousLogger().log(Level.INFO,
55+
"processing annotation: {0}",
56+
pat.
57+
getAnnotatedType().
58+
getJavaClass().
59+
getName());
60+
}
61+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.javaee7.cdi.extension.impl.MyExtension
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/*
4+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5+
*
6+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
7+
*
8+
* The contents of this file are subject to the terms of either the GNU
9+
* General Public License Version 2 only ("GPL") or the Common Development
10+
* and Distribution License("CDDL") (collectively, the "License"). You
11+
* may not use this file except in compliance with the License. You can
12+
* obtain a copy of the License at
13+
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
14+
* or packager/legal/LICENSE.txt. See the License for the specific
15+
* language governing permissions and limitations under the License.
16+
*
17+
* When distributing the software, include this License Header Notice in each
18+
* file and include the License file at packager/legal/LICENSE.txt.
19+
*
20+
* GPL Classpath Exception:
21+
* Oracle designates this particular file as subject to the "Classpath"
22+
* exception as provided by Oracle in the GPL Version 2 section of the License
23+
* file that accompanied this code.
24+
*
25+
* Modifications:
26+
* If applicable, add the following below the License Header, with the fields
27+
* enclosed by brackets [] replaced by your own identifying information:
28+
* "Portions Copyright [year] [name of copyright owner]"
29+
*
30+
* Contributor(s):
31+
* If you wish your version of this file to be governed by only the CDDL or
32+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
33+
* elects to include this software in this distribution under the [CDDL or GPL
34+
* Version 2] license." If you don't indicate a single choice of license, a
35+
* recipient has the option to distribute your version of this file under
36+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
37+
* its licensees as provided above. However, if you add GPL Version 2 code
38+
* and therefore, elected the GPL Version 2 license, then the option applies
39+
* only if the new code is made subject to such option by the copyright
40+
* holder.
41+
*/
42+
-->
43+
<beans
44+
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
45+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
46+
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
47+
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
48+
bean-discovery-mode="all">
49+
</beans>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<!--
2+
/*
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4+
*
5+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
6+
*
7+
* The contents of this file are subject to the terms of either the GNU
8+
* General Public License Version 2 only ("GPL") or the Common Development
9+
* and Distribution License("CDDL") (collectively, the "License"). You
10+
* may not use this file except in compliance with the License. You can
11+
* obtain a copy of the License at
12+
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
13+
* or packager/legal/LICENSE.txt. See the License for the specific
14+
* language governing permissions and limitations under the License.
15+
*
16+
* When distributing the software, include this License Header Notice in each
17+
* file and include the License file at packager/legal/LICENSE.txt.
18+
*
19+
* GPL Classpath Exception:
20+
* Oracle designates this particular file as subject to the "Classpath"
21+
* exception as provided by Oracle in the GPL Version 2 section of the License
22+
* file that accompanied this code.
23+
*
24+
* Modifications:
25+
* If applicable, add the following below the License Header, with the fields
26+
* enclosed by brackets [] replaced by your own identifying information:
27+
* "Portions Copyright [year] [name of copyright owner]"
28+
*
29+
* Contributor(s):
30+
* If you wish your version of this file to be governed by only the CDDL or
31+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
32+
* elects to include this software in this distribution under the [CDDL or GPL
33+
* Version 2] license." If you don't indicate a single choice of license, a
34+
* recipient has the option to distribute your version of this file under
35+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
36+
* its licensees as provided above. However, if you add GPL Version 2 code
37+
* and therefore, elected the GPL Version 2 license, then the option applies
38+
* only if the new code is made subject to such option by the copyright
39+
* holder.
40+
*/
41+
-->
42+
<%@page contentType="text/html" pageEncoding="UTF-8"%>
43+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
44+
"http://www.w3.org/TR/html4/loose.dtd">
45+
46+
<html>
47+
<head>
48+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
49+
<title>CDI Extension Implementation</title>
50+
</head>
51+
<body>
52+
<h1>CDI Extension Implementation</h1>
53+
This project generates a JAR file that is integrated in a WAR file built using "extension" project. Nothing to invoke here.
54+
</body>
55+
</html>

0 commit comments

Comments
 (0)