Index: src/main/java/com/sun/faces/extensions/devtime/zdt/JmxPhaseListener.java =================================================================== --- src/main/java/com/sun/faces/extensions/devtime/zdt/JmxPhaseListener.java (revision 557) +++ src/main/java/com/sun/faces/extensions/devtime/zdt/JmxPhaseListener.java (working copy) @@ -1,164 +0,0 @@ -/* - * JmxPhaseListener.java - * - * Created on November 29, 2006, 4:22 PM - * - * The contents of this file are subject to the terms - * of the Common Development and Distribution License - * (the License). You may not use this file except in - * compliance with the License. - * - * You can obtain a copy of the License at - * https://javaserverfaces.dev.java.net/CDDL.html or - * legal/CDDLv1.0.txt. - * See the License for the specific language governing - * permission and limitations under the License. - * - * When distributing Covered Code, include this CDDL - * Header Notice in each file and include the License file - * at legal/CDDLv1.0.txt. - * If applicable, add the following below the CDDL Header, - * with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * [Name of File] [ver.__] [Date] - * - * Copyright 2006 Sun Microsystems Inc. All Rights Reserved - */ - -package com.sun.faces.extensions.devtime.zdt; - -import javax.faces.component.UIViewRoot; -import javax.faces.context.ExternalContext; -import javax.faces.context.FacesContext; -import javax.faces.event.PhaseEvent; -import javax.faces.event.PhaseId; -import javax.faces.event.PhaseListener; - -/** - * - * @author edburns - */ -public class JmxPhaseListener implements PhaseListener { - - public static final String RESTART_PASSWORD_PARAM_NAME = - "com.sun.faces.RESTART_PASSWORD"; - - public static final String ADMIN_PASSWORD_PARAM_NAME = - "com.sun.faces.ADMIN_PASSWORD"; - - public static final String ADMIN_PORT_PARAM_NAME = - "com.sun.faces.ADMIN_PORT"; - - /** Creates a new instance of JmxPhaseListener */ - public JmxPhaseListener() { - } - - public String toString() { - String retValue; - - retValue = super.toString(); - return retValue; - } - - public PhaseId getPhaseId() { - return PhaseId.RESTORE_VIEW; - } - - public void beforePhase(PhaseEvent phaseEvent) { - } - - public void afterPhase(PhaseEvent phaseEvent) { - FacesContext context = phaseEvent.getFacesContext(); - UIViewRoot root = context.getViewRoot(); - String viewId = root.getViewId(); - - if (!viewId.contains("/restart")) { - return; - } - - doRestart(context); - - } - - private void doRestart(FacesContext context) { - ExternalContext extContext = context.getExternalContext(); - String restartPasswordParam = extContext.getRequestParameterMap().get("password"), - restartPassword = getRestartPassword(extContext); - assert(null != restartPassword); - - // If there is no password param, take no action - if (null == restartPasswordParam) { - return; - } - - // If the restart password param is not equal to the restart password, - // take no action - if (!restartPasswordParam.equals(restartPassword)) { - return; - } - - String contextRoot = extContext.getRequestContextPath(); - if (null == contextRoot) { - return; - } - if (contextRoot.startsWith("/")) { - contextRoot = contextRoot.substring(1); - } - final String [] args = { "--restart", "localhost", contextRoot, "admin", - getAdminPassword(extContext), getAdminPort(extContext) }; - Runnable doRestart = new Runnable() { - public void run() { - try { - JMXDeploy.main(args); - - } catch (Exception ex) { - ex.printStackTrace(); - } - } - - }; - Thread restartThread = new Thread(doRestart); - restartThread.start(); - context.responseComplete(); - } - - private String getRestartPassword(ExternalContext extContext) { - String restartPassword = "adminadmin"; - - String contextRestartPassword = - extContext.getInitParameter(RESTART_PASSWORD_PARAM_NAME); - if (null != contextRestartPassword) { - restartPassword = contextRestartPassword; - } - - return restartPassword; - } - - private String getAdminPassword(ExternalContext extContext) { - String restartPassword = "adminadmin"; - - String contextRestartPassword = - extContext.getInitParameter(ADMIN_PASSWORD_PARAM_NAME); - if (null != contextRestartPassword) { - restartPassword = contextRestartPassword; - } - - return restartPassword; - } - - private String getAdminPort(ExternalContext extContext) { - String restartPassword = "4848"; - - String contextRestartPassword = - extContext.getInitParameter(ADMIN_PORT_PARAM_NAME); - if (null != contextRestartPassword) { - restartPassword = contextRestartPassword; - } - - return restartPassword; - } - - -} Index: src/main/java/com/sun/faces/extensions/devtime/zdt/JMXDeploy.java =================================================================== --- src/main/java/com/sun/faces/extensions/devtime/zdt/JMXDeploy.java (revision 557) +++ src/main/java/com/sun/faces/extensions/devtime/zdt/JMXDeploy.java (working copy) @@ -1,272 +0,0 @@ -/* - * JMXDeploy.java - * - * Created on November 29, 2006, 4:29 PM - * - * The contents of this file are subject to the terms - * of the Common Development and Distribution License - * (the License). You may not use this file except in - * compliance with the License. - * - * You can obtain a copy of the License at - * https://javaserverfaces.dev.java.net/CDDL.html or - * legal/CDDLv1.0.txt. - * See the License for the specific language governing - * permission and limitations under the License. - * - * When distributing Covered Code, include this CDDL - * Header Notice in each file and include the License file - * at legal/CDDLv1.0.txt. - * If applicable, add the following below the CDDL Header, - * with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * [Name of File] [ver.__] [Date] - * - * Copyright 2006 Sun Microsystems Inc. All Rights Reserved - */ - -package com.sun.faces.extensions.devtime.zdt; - -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.net.URL; -import java.net.URLConnection; -import java.util.HashMap; -import java.util.Map; -import javax.management.MBeanServerConnection; -import javax.management.ObjectName; -import javax.management.remote.JMXConnector; -import javax.management.remote.JMXConnectorFactory; -import javax.management.remote.JMXServiceURL; - - -/** - * Small Util to reload/restart a WebModule using JMX. - * - * @author Jeanfrancois Arcand - */ -public class JMXDeploy{ - - private final static String mBeanName = "com.sun.appserv:" - + "J2EEApplication=null,J2EEServer=server," - + "j2eeType=WebModule,name=//server"; - - private URLConnection conn = null; - private URL url; - private ObjectOutputStream objectWriter = null; - private ObjectInputStream objectReader = null; - private String adminUser = null; - private String adminPassword = null; - private int adminPort = 4848; - private String contextRoot= ""; - private String host = "localhost"; - private String command = null; - - public static void main(String args[]) throws Exception{ - JMXDeploy instance = new JMXDeploy(args); - instance.handleCommand(); - } - - public JMXDeploy(String args[]) { - command = args[0]; - host = args[1]; - contextRoot = "/" + args[2]; - adminUser = args[3]; - adminPassword = args[4]; - adminPort = Integer.parseInt(args[5]); - } - - private void handleCommand() throws Exception { - try{ - if ( command.equals("--restart")){ - restart(mBeanName + contextRoot); - } else if (command.equals("--reload")){ - reload(mBeanName + contextRoot); - } - System.out.println("DEPLOYMENT SUCCESS"); - } catch(Throwable ex){ - System.out.println("Usage\n"); - System.out.println("jmxReload --reload|restart"); - System.out.print(" [contextRoot]"); - ex.printStackTrace(); - System.out.println("DEPLOYMENT FAILED"); - } - - } - - - private void restart(String oName) throws Throwable{ - ObjectName appMBean = new ObjectName(oName); - - try { - restartHttp(appMBean); - } catch (Throwable t){ - restartHttps(appMBean); - } - } - - - private void reload(String oName) throws Throwable{ - ObjectName appMBean = new ObjectName(oName); - - try { - reloadHttp(appMBean); - } catch (Throwable t){ - t.printStackTrace(); - reloadHttps(appMBean); - } - } - - - /** - * Reload the Context using JMX and HTTP. - */ - private void reloadHttp(ObjectName appMBean) throws Throwable { - - Object[] params = new Object[0]; - String[] signature = new String[0]; - System.out.println("Reload Context: " + contextRoot); - - Object o= getMBeanServerConnection(). - invoke(appMBean, "reload", params, signature); - } - - - /** - * Reload the Context using JMX and HTTP. - */ - private void restartHttp(ObjectName appMBean) throws Throwable { - Object[] params = new Object[0]; - String[] signature = new String[0]; - final String localContextRoot = contextRoot; - System.out.println("Stopping Context: " + localContextRoot); - - Object o= getMBeanServerConnection(). - invoke(appMBean, "stop", params, signature); - - System.out.println("Starting Context: " + localContextRoot); - - o= getMBeanServerConnection() - .invoke(appMBean, "start", params, signature); - } - - - /** - * Local the MBeanServer. - */ - private MBeanServerConnection getMBeanServerConnection() - throws Throwable{ - return getMBeanServerConnection(host,adminPort,adminUser,adminPassword); - } - - - /** - * Get an Server Connection. - */ - private MBeanServerConnection getMBeanServerConnection - (String host, - int port, - String user, - String password) throws Throwable{ - - final JMXServiceURL url = - new JMXServiceURL("service:jmx:s1ashttp://" + host + ":" + port); - final Map env = new HashMap(); - final String PKGS = "com.sun.enterprise.admin.jmx.remote.protocol"; - - env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, PKGS); - env.put(ADMIN_USER_ENV_PROPERTY_NAME, user ); - env.put( ADMIN_PASSWORD_ENV_PROPERTY_NAME, password); - env.put(HTTP_AUTH_PROPERTY_NAME, DEFAULT_HTTP_AUTH_SCHEME); - final JMXConnector conn = JMXConnectorFactory.connect(url, env); - return conn.getMBeanServerConnection(); - } - - - /** - * Reload the Context using JMX and HTTPs - */ - private void reloadHttps(ObjectName appMBean) throws Throwable { - Object[] params = new Object[0]; - String[] signature = new String[0]; - System.out.println("Reloading Context: " + contextRoot); - - Object o= getSecureMBeanServerConnection() - .invoke(appMBean, "reload", params, signature); - - } - - - /** - * Reload the Context using JMX and HTTPs - */ - private void restartHttps(ObjectName appMBean) throws Throwable { - Object[] params = new Object[0]; - String[] signature = new String[0]; - final String localContextRoot = contextRoot; - System.out.println("Stopping Context: " + localContextRoot); - - Object o= getSecureMBeanServerConnection() - .invoke(appMBean, "stop", params, signature); - - System.out.println("Starting Context: " + localContextRoot); - - o= getSecureMBeanServerConnection().invoke( - appMBean, "start", params, signature); - } - - - /** - * Get a secure JMX connection. - */ - private MBeanServerConnection getSecureMBeanServerConnection() - throws Throwable{ - return getSecureMBeanServerConnection(host,adminPort,adminUser, - adminPassword); - } - - - /** - * Get a secure JMX connection. - */ - private MBeanServerConnection - getSecureMBeanServerConnection(String host, - int port, - String user, - String password) throws Throwable{ - - final JMXServiceURL url = new JMXServiceURL("service:jmx:s1ashttps://" + - host + ":" + port); - final Map env = new HashMap(); - final String PKGS = "com.sun.enterprise.admin.jmx.remote.protocol"; - - env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, PKGS); - env.put(ADMIN_USER_ENV_PROPERTY_NAME, user ); - env.put( ADMIN_PASSWORD_ENV_PROPERTY_NAME, password); - env.put(HTTP_AUTH_PROPERTY_NAME, DIGEST_HTTP_AUTH_SCHEME); - final JMXConnector conn = JMXConnectorFactory.connect(url, env); - return conn.getMBeanServerConnection(); - } - -// --------------------------------------------------------------- AMX related - - - public static final String ADMIN_USER_ENV_PROPERTY_NAME = "USER"; - public static final String ADMIN_PASSWORD_ENV_PROPERTY_NAME = "PASSWORD"; - public static final String TRUST_MANAGER_PROPERTY_NAME = "TRUST_MANAGER_KEY"; - public static final String KEY_MANAGER_PROPERTY_NAME= "KEYMANAGER_KEY"; - public static final String SSL_SOCKET_FACTORY = "SSL_SOCKET_FACTORY"; - public static final String HOSTNAME_VERIFIER_PROPERTY_NAME = "HOSTNAME_VERIFIER_KEY"; - public static final String STRING_MANAGER_CLASS_NAME = "STRING_MANAGER_CLASS_KEY"; - public static final String DEFAULT_TRUST_MANAGER = "com.sun.enterprise.security.trustmanager.SunOneBasicX509TrustManager"; - public static final String SERVLET_CONTEXT_PROPERTY_NAME = "com.sun.enterprise.as.context.root"; - public static final String HTTP_AUTH_PROPERTY_NAME = "com.sun.enterprise.as.http.auth"; - public static final String DEFAULT_SERVLET_CONTEXT_ROOT = "/web1/remotejmx"; /* This is to be in sync with the web.xml */ - public static final String DEFAULT_HTTP_AUTH_SCHEME = "BASIC"; - public static final String DIGEST_HTTP_AUTH_SCHEME = "Digest"; - - public static final String S1_HTTP_PROTOCOL = "s1ashttp"; - public static final String S1_HTTPS_PROTOCOL = "s1ashttps"; -} Index: src/main/java/com/sun/faces/extensions/devtime/tproxyd/TProxyD.java =================================================================== --- src/main/java/com/sun/faces/extensions/devtime/tproxyd/TProxyD.java (revision 557) +++ src/main/java/com/sun/faces/extensions/devtime/tproxyd/TProxyD.java (working copy) @@ -1,84 +0,0 @@ -/* - * TProxyD.java - * - * Created on July 9, 2006, 2:00 PM - * - * To change this template, choose Tools | Template Manager - * and open the template in the editor. - */ - -package com.sun.faces.extensions.devtime.tproxyd; - -import java.io.InputStream; -import java.net.InetAddress; -import java.net.ServerSocket; -import java.net.Socket; -import javax.net.ServerSocketFactory; -import javax.net.SocketFactory; - -/** - * - * @author edburns - */ -public class TProxyD { - - /** Creates a new instance of TProxyD */ - private TProxyD() { - } - - private InetAddress targetAddress; - - private static final int DEFAULT_TARGET_PORT = 8080; - private int targetPort; - - private static final int DEFAULT_PORT = 8070; - private int myPort; - - private void parseArgs(String[] args) throws Exception { - myPort = DEFAULT_PORT; - - targetAddress = InetAddress.getLocalHost(); - targetPort = DEFAULT_TARGET_PORT; - } - - private void printUsage() { - - } - - private String readRequest(InputStream is) { - String result = null; - - return result; - } - - private void doProxy() throws Exception { - ServerSocketFactory serverFactory = ServerSocketFactory.getDefault(); - SocketFactory targetFactory = SocketFactory.getDefault(); - ServerSocket s = null; - Socket client = null, target = null; - boolean keepRunning = true; - String clientRequest = null; - do { - s = serverFactory.createServerSocket(myPort); - client = s.accept(); - clientRequest = readRequest(client.getInputStream()); - - } while (keepRunning); - } - - /** - * @param args the command line arguments - */ - public static void main(String[] args) { - - TProxyD instance = new TProxyD(); - try { - instance.parseArgs(args); - instance.doProxy(); - } - catch (Throwable e) { - instance.printUsage(); - } - } - -} Index: src/main/resources/faces-config.xml =================================================================== --- src/main/resources/faces-config.xml (revision 557) +++ src/main/resources/faces-config.xml (working copy) @@ -1,33 +0,0 @@ - - - - - - - - com.sun.faces.extensions.devtime.zdt.JmxPhaseListener - - - Index: src/main/resources/MANIFEST.MF =================================================================== --- src/main/resources/MANIFEST.MF (revision 557) +++ src/main/resources/MANIFEST.MF (working copy) @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Main-Class: com.sun.faces.extensions.devtime.tproxyd.TProxyD - Index: pom.xml =================================================================== --- pom.xml (revision 557) +++ pom.xml (working copy) @@ -1,72 +1,23 @@ - - 4.0.0 - com.sun.faces.extensions - jsf-extensions-dev-time - ${jar.full.version} - jar - jsf-extensions-dev-time - https://jsf-extensions.dev.java.net/ - - Dev time jsf-extensions - - - - com.sun.faces.extensions.maven - jsf-extensions-master - 2.0-SNAPSHOT - - - - - - src/main/java - install - - - maven-source-plugin - - - source - generate-resources - - jar - - - - - - - - src/main/resources - - *.properties - - - - META-INF - src/main/resources - - MANIFEST.MF - faces-config.xml - - - - - - - - - - true - - org.apache.maven.plugins - maven-project-info-reports-plugin - - - - - - - + + + 4.0.0 + + com.sun.faces.extensions + jsf-extensions-devtime-master + ${jar.full.version} + pom + jsf-extensions-dev-time-master + https://jsf-extensions.dev.java.net/> + JSF Extenstions Annotations Library Master + + + com.sun.faces.extensions.maven + jsf-extensions-master + 2.0-SNAPSHOT + + + + annotations + misc + + Index: misc/pom.xml =================================================================== --- misc/pom.xml (revision 557) +++ misc/pom.xml (working copy) @@ -5,7 +5,9 @@ com.sun.faces.extensions jsf-extensions-dev-time jar + ${jar.full.version} jsf-extensions-dev-time + https://jsf-extensions.dev.java.net/ Dev time jsf-extensions @@ -14,7 +16,7 @@ com.sun.faces.extensions.maven jsf-extensions-master - 0.1 + 2.0-SNAPSHOT Property changes on: annotations/processor ___________________________________________________________________ Added: svn:ignore + target Property changes on: annotations/processor/src/main/resources/com/sun/faces/mirror/generator ___________________________________________________________________ Added: svn:ignore + .TagSource.template Index: annotations/processor/pom.xml =================================================================== --- annotations/processor/pom.xml (revision 557) +++ annotations/processor/pom.xml (working copy) @@ -5,9 +5,11 @@ jsf-extensions-dev-time-annotations-processor jar jsf-extensions-dev-time-annotations-processor + ${jar.full.version} + https://jsf-extensions.dev.java.net/ Annotations for creating UIComponents more easily - 0.1 + @@ -21,13 +23,11 @@ - @@ -54,6 +54,7 @@ jsf-extensions-dev-time-annotations 0.1 + junit junit Property changes on: annotations/library ___________________________________________________________________ Added: svn:ignore + target Index: annotations/library/pom.xml =================================================================== --- annotations/library/pom.xml (revision 557) +++ annotations/library/pom.xml (working copy) @@ -4,9 +4,11 @@ 4.0.0 com.sun.faces.extensions jsf-extensions-dev-time-annotations + ${jar.full.version} jar jsf-extensions-dev-time-annotations https://jsf-extensions.dev.java.net/ + Annotations for creating UIComponents more easily @@ -14,6 +16,6 @@ com.sun.faces.extensions.maven jsf-extensions-master - 0.1 + 2.0-SNAPSHOT Index: annotations/pom.xml =================================================================== --- annotations/pom.xml (revision 557) +++ annotations/pom.xml (working copy) @@ -3,17 +3,17 @@ 4.0.0 com.sun.faces.extensions - jsf-extensions-annotations-master + jsf-extensions-dev-time-annotations-master ${jar.full.version} pom - jsf-extensions-dev-timeannotations-master + jsf-extensions-annotations-master https://jsf-extensions.dev.java.net/> JSF Extenstions Annotations Library Master com.sun.faces.extensions.maven jsf-extensions-master - 0.1 + 2.0-SNAPSHOT