geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shiv...@apache.org
Subject svn commit: r679414 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/ org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/ org.apache.geronimo.st.v...
Date Thu, 24 Jul 2008 14:13:50 GMT
Author: shivahr
Date: Thu Jul 24 07:13:50 2008
New Revision: 679414

URL: http://svn.apache.org/viewvc?rev=679414&view=rev
Log:
GERONIMODEVTOOLS-448 Cache the Dynamic server info retrieved using JMX. Thanks to Sainath
for the patch.

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoFormContentLoader.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServerInfo.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoFormContentLoader.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoFormContentLoader.java?rev=679414&r1=679413&r2=679414&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoFormContentLoader.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoFormContentLoader.java
Thu Jul 24 07:13:50 2008
@@ -38,6 +38,7 @@
 	 * @see org.apache.geronimo.st.ui.editors.IGeronimoFormContentLoader#doAddPages(org.eclipse.ui.forms.editor.FormEditor)
 	 */
 	public void doAddPages(FormEditor editor) throws PartInitException{
+        triggerGeronimoServerInfoUpdate();
 		IEditorInput input = editor.getEditorInput();
 		if(input instanceof IFileEditorInput) {
 			String planFileName = ((IFileEditorInput) input).getFile().getName();
@@ -55,6 +56,8 @@
 		}
 	}
 	
+	abstract public void triggerGeronimoServerInfoUpdate() throws PartInitException;
+	
 	abstract public void addWebPlanPages(FormEditor editor) throws PartInitException;
 	
 	abstract public void addOpenEjbPlanPages(FormEditor editor) throws PartInitException;

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServerInfo.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServerInfo.java?rev=679414&r1=679413&r2=679414&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServerInfo.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServerInfo.java
Thu Jul 24 07:13:50 2008
@@ -53,6 +53,15 @@
 
     private ArrayList<Kernel> kernels;
 
+    private ArrayList<Pattern> deployedEJBs;
+    private ArrayList<String> securityRealms;
+    private ArrayList<Pattern> jmsConnectionFactories;
+    private ArrayList<Pattern> jmsDestinations;
+    private ArrayList<Pattern> jdbcConnectionPools;
+    private ArrayList<Pattern> javaMailResources;
+    private ArrayList<org.apache.geronimo.jee.deployment.Pattern> credentialStores;
+    private ArrayList<Dependency> commonLibs;
+
     // singleton class
     private GeronimoServerInfo() {
     }
@@ -63,25 +72,91 @@
         return instance;
     }
 
-    public List<Pattern> getDeployedEJBs() {
+    public ArrayList<Pattern> getDeployedEjbs() {
+        return deployedEJBs;
+    }
+
+    public ArrayList<String> getSecurityRealms() {
+        return securityRealms;
+    }
+
+    public ArrayList<Pattern> getJmsConnectionFactories() {
+        return jmsConnectionFactories;
+    }
+
+    public ArrayList<Pattern> getJmsDestinations() {
+        return jmsDestinations;
+    }
+
+    public ArrayList<Pattern> getJdbcConnectionPools() {
+        return jdbcConnectionPools;
+    }
+
+    public ArrayList<Pattern> getJavaMailSessions() {
+        return javaMailResources;
+    }
+
+    public ArrayList<org.apache.geronimo.jee.deployment.Pattern> getDeployedCredentialStores()
{
+        return credentialStores;
+    }
+
+    public ArrayList<Dependency> getCommonLibs() {
+        return commonLibs;
+    }
+
+    public void updateInfo() {
+        updateKernels();
+        updateDeployedEJBs();
+        updateSecurityRealms();
+        updateJmsConnectionFactories();
+        updateJmsDestinations();
+        updateJdbcConnectionPools();
+        updateJavaMailSessions();
+        updateDeployedCredentialStores();
+        updateCommonLibs();
+    }
+
+    private void updateKernels() {
+        kernels = new ArrayList<Kernel>();
+        IServer[] servers = ServerCore.getServers();
+        for (int i = 0; i < servers.length; i++) {
+            if (servers[i].getServerState() == IServer.STATE_STARTED) {
+                try {
+                    GeronimoServerBehaviourDelegate delegate = (GeronimoServerBehaviourDelegate)
servers[i]
+                            .getAdapter(GeronimoServerBehaviourDelegate.class);
+                    if (delegate != null) {
+                        MBeanServerConnection connection = delegate
+                                .getServerConnection();
+                        if (connection != null) {
+                            kernels.add(new KernelDelegate(connection));
+                        }
+                    }
+                } catch (SecurityException e) {
+                } catch (Exception e) {
+                    Trace.trace(Trace.WARNING, "Kernel connection failed. "
+                            + e.getMessage());
+                }
+            }
+        }
+    }
+
+    private void updateDeployedEJBs() {
+        deployedEJBs = new ArrayList<Pattern>();
         ArrayList<Pattern> statelessSessionBeans = getByType("StatelessSessionBean");
         ArrayList<Pattern> statefulSessionBeans = getByType("StatefulSessionBean");
         ArrayList<Pattern> messageDrivenBeans = getByType("MessageDrivenBean");
         ArrayList<Pattern> entityBeans = getByType("EntityBean");
-        ArrayList<Pattern> deployedEJBs = new ArrayList<Pattern>();
         deployedEJBs.addAll(statelessSessionBeans);
         deployedEJBs.addAll(statefulSessionBeans);
         deployedEJBs.addAll(messageDrivenBeans);
         deployedEJBs.addAll(entityBeans);
-        return deployedEJBs;
     }
 
-    public List<String> getSecurityRealms() {
-        ArrayList<String> securityRealms = new ArrayList<String>();
-        Map m = null;
-        m = Collections.singletonMap("j2eeType", "SecurityRealm");
-        AbstractNameQuery query = new AbstractNameQuery(null, m, Collections.EMPTY_SET);
-        updateKernels();
+    private void updateSecurityRealms() {
+        securityRealms = new ArrayList<String>();
+        Map map = Collections.singletonMap("j2eeType", "SecurityRealm");
+        AbstractNameQuery query = new AbstractNameQuery(null, map,
+                Collections.EMPTY_SET);
         for (int i = 0; i < kernels.size(); i++) {
             Set beans = kernels.get(i).listGBeans(query);
             for (Iterator it = beans.iterator(); it.hasNext();) {
@@ -92,52 +167,51 @@
                 }
             }
         }
-        return securityRealms;
     }
 
-    public List<Pattern> getJMSConnectionFactories() {
-        String[] requiredInterfaces = new String[] { "javax.jms.ConnectionFactory",
-                "javax.jms.QueueConnectionFactory", "javax.jms.TopicConnectionFactory", };
+    private void updateJmsConnectionFactories() {
+        String[] requiredInterfaces = new String[] {
+                "javax.jms.ConnectionFactory",
+                "javax.jms.QueueConnectionFactory",
+                "javax.jms.TopicConnectionFactory", };
         String attribute = "implementedInterfaces";
-        ArrayList<Pattern> jmsConnectionFactories = getByTypeAttributeValues(
+        jmsConnectionFactories = getByTypeAttributeValues(
                 "JCAManagedConnectionFactory", attribute, requiredInterfaces);
-        return jmsConnectionFactories;
     }
 
-    public List<Pattern> getJMSDestinations() {
-        String[] requiredInterfaces = new String[] { "javax.jms.Queue", "javax.jms.Topic"
};
+    private void updateJmsDestinations() {
+        String[] requiredInterfaces = new String[] { "javax.jms.Queue",
+                "javax.jms.Topic" };
         String attribute = "adminObjectInterface";
-        ArrayList<Pattern> jmsDestinations = getByTypeAttributeValues("JCAAdminObject",
attribute,
+        jmsDestinations = getByTypeAttributeValues("JCAAdminObject", attribute,
                 requiredInterfaces);
-        return jmsDestinations;
     }
 
-    public List<Pattern> getJDBCConnectionPools() {
+    private void updateJdbcConnectionPools() {
         String[] acceptedValues = new String[] { "javax.sql.DataSource" };
         String attribute = "connectionFactoryInterface";
-        ArrayList<Pattern> jdbcConnectionPools = getByTypeAttributeValues(
+        jdbcConnectionPools = getByTypeAttributeValues(
                 "JCAManagedConnectionFactory", attribute, acceptedValues);
-        return jdbcConnectionPools;
 
     }
 
-    public List<Pattern> getJavaMailSessions() {
-        ArrayList<Pattern> javaMailResources = getByType("JavaMailResource");
-        return javaMailResources;
+    private void updateJavaMailSessions() {
+        javaMailResources = getByType("JavaMailResource");
     }
 
-    public List<org.apache.geronimo.jee.deployment.Pattern> getDeployedCredentialStores()
{
-        ArrayList<org.apache.geronimo.jee.deployment.Pattern> credentialStores = new
ArrayList<org.apache.geronimo.jee.deployment.Pattern>();
+    private void updateDeployedCredentialStores() {
+        credentialStores = new ArrayList<org.apache.geronimo.jee.deployment.Pattern>();
         Map map = Collections.singletonMap("j2eeType", "GBean");
-        AbstractNameQuery query = new AbstractNameQuery(null, map, Collections.EMPTY_SET);
-        updateKernels();
+        AbstractNameQuery query = new AbstractNameQuery(null, map,
+                Collections.EMPTY_SET);
         for (int i = 0; i < kernels.size(); i++) {
             Set beans = kernels.get(i).listGBeans(query);
             for (Iterator it = beans.iterator(); it.hasNext();) {
                 AbstractName abstractName = (AbstractName) it.next();
                 try {
                     GBeanInfo info = kernels.get(i).getGBeanInfo(abstractName);
-                    GAttributeInfo attribInfo = info.getAttribute("credentialStore");
+                    GAttributeInfo attribInfo = info
+                            .getAttribute("credentialStore");
                     if (attribInfo != null) {
                         Artifact artifact = abstractName.getArtifact();
                         Object name = abstractName.getName().get("name");
@@ -157,15 +231,14 @@
                 }
             }
         }
-        return credentialStores;
     }
 
-    public List<Dependency> getCommonLibs() {
+    private void updateCommonLibs() {
         List<Object> artifacts = null;
-        ArrayList<Dependency> dependencies = new ArrayList<Dependency>();
+        commonLibs = new ArrayList<Dependency>();
         Map map = Collections.singletonMap("j2eeType", "Repository");
-        AbstractNameQuery query = new AbstractNameQuery(null, map, Collections.EMPTY_SET);
-        updateKernels();
+        AbstractNameQuery query = new AbstractNameQuery(null, map,
+                Collections.EMPTY_SET);
         for (int i = 0; i < kernels.size(); i++) {
             Set beans = kernels.get(i).listGBeans(query);
             for (Iterator it = beans.iterator(); it.hasNext();) {
@@ -177,13 +250,16 @@
                         artifacts = Arrays.asList(((TreeSet) value).toArray());
                     }
                 } catch (GBeanNotFoundException e) {
-                    Trace.trace(Trace.WARNING, "GBean Not Found. " + e.getMessage());
+                    Trace.trace(Trace.WARNING, "GBean Not Found. "
+                            + e.getMessage());
                 } catch (NoSuchOperationException e) {
-                    Trace.trace(Trace.WARNING, "The operation cant invoked. " + e.getMessage());
+                    Trace.trace(Trace.WARNING, "The operation cant invoked. "
+                            + e.getMessage());
                 } catch (InternalKernelException e) {
                     throw e;
                 } catch (Exception e) {
-                    Trace.trace(Trace.WARNING, "Kernel connection failed.  " + e.getMessage());
+                    Trace.trace(Trace.WARNING, "Kernel connection failed.  "
+                            + e.getMessage());
                 }
 
             }
@@ -191,41 +267,49 @@
         if (artifacts != null) {
             for (int i = 0; i < artifacts.size(); i++) {
                 Dependency dependency = new Dependency();
-                dependency.setArtifactId(((Artifact) artifacts.get(i)).getArtifactId());
-                dependency.setGroupId(((Artifact) artifacts.get(i)).getGroupId());
-                dependency.setVersion(((Artifact) artifacts.get(i)).getVersion().toString());
+                dependency.setArtifactId(((Artifact) artifacts.get(i))
+                        .getArtifactId());
+                dependency.setGroupId(((Artifact) artifacts.get(i))
+                        .getGroupId());
+                dependency.setVersion(((Artifact) artifacts.get(i))
+                        .getVersion().toString());
                 dependency.setType(((Artifact) artifacts.get(i)).getType());
-                if (!dependencies.contains(dependency)) {
-                    dependencies.add(dependency);
+                if (!commonLibs.contains(dependency)) {
+                    commonLibs.add(dependency);
                 }
             }
         }
-        return dependencies;
     }
 
-    protected ArrayList<Pattern> getByTypeAttributeValues(String type, String attribute,
-            String[] acceptedValues) {
+    private ArrayList<Pattern> getByTypeAttributeValues(String type,
+            String attribute, String[] acceptedValues) {
         ArrayList<Pattern> result = new ArrayList<Pattern>();
         Map map = Collections.singletonMap("j2eeType", type);
-        AbstractNameQuery query = new AbstractNameQuery(null, map, Collections.EMPTY_SET);
-        updateKernels();
+        AbstractNameQuery query = new AbstractNameQuery(null, map,
+                Collections.EMPTY_SET);
         for (int i = 0; i < kernels.size(); i++) {
             Set beans = kernels.get(i).listGBeans(query);
             for (Iterator it = beans.iterator(); it.hasNext();) {
                 AbstractName abstractName = (AbstractName) it.next();
                 try {
-                    Object value = kernels.get(i).getAttribute(abstractName, attribute);
+                    Object value = kernels.get(i).getAttribute(abstractName,
+                            attribute);
                     if (value != null) {
                         if (value instanceof String[]) {
-                            List<String> interfaces = Arrays.asList((String[]) value);
+                            List<String> interfaces = Arrays
+                                    .asList((String[]) value);
                             for (int j = 0; j < acceptedValues.length; j++) {
                                 if (interfaces.contains(acceptedValues[j])) {
                                     Pattern pattern = new Pattern();
-                                    Artifact artifact = abstractName.getArtifact();
-                                    pattern.setArtifactId(artifact.getArtifactId());
+                                    Artifact artifact = abstractName
+                                            .getArtifact();
+                                    pattern.setArtifactId(artifact
+                                            .getArtifactId());
                                     pattern.setGroupId(artifact.getGroupId());
-                                    pattern.setVersion(artifact.getVersion().toString());
-                                    pattern.setName((String) abstractName.getName().get("name"));
+                                    pattern.setVersion(artifact.getVersion()
+                                            .toString());
+                                    pattern.setName((String) abstractName
+                                            .getName().get("name"));
                                     if (!result.contains(pattern)) {
                                         result.add(pattern);
                                     }
@@ -238,11 +322,15 @@
                             for (int j = 0; j < acceptedValues.length; j++) {
                                 if (interfaces.contains(acceptedValues[j])) {
                                     Pattern pattern = new Pattern();
-                                    Artifact artifact = abstractName.getArtifact();
-                                    pattern.setArtifactId(artifact.getArtifactId());
+                                    Artifact artifact = abstractName
+                                            .getArtifact();
+                                    pattern.setArtifactId(artifact
+                                            .getArtifactId());
                                     pattern.setGroupId(artifact.getGroupId());
-                                    pattern.setVersion(artifact.getVersion().toString());
-                                    pattern.setName((String) abstractName.getName().get("name"));
+                                    pattern.setVersion(artifact.getVersion()
+                                            .toString());
+                                    pattern.setName((String) abstractName
+                                            .getName().get("name"));
                                     if (!result.contains(pattern)) {
                                         result.add(pattern);
                                     }
@@ -254,18 +342,19 @@
                 } catch (GBeanNotFoundException e) {
                 } catch (NoSuchAttributeException e) {
                 } catch (Exception e) {
-                    Trace.trace(Trace.WARNING, "Kernel connection failed. " + e.getMessage());
+                    Trace.trace(Trace.WARNING, "Kernel connection failed. "
+                            + e.getMessage());
                 }
             }
         }
         return result;
     }
 
-    protected ArrayList<Pattern> getByType(String type) {
+    private ArrayList<Pattern> getByType(String type) {
         ArrayList<Pattern> result = new ArrayList<Pattern>();
         Map map = Collections.singletonMap("j2eeType", type);
-        AbstractNameQuery query = new AbstractNameQuery(null, map, Collections.EMPTY_SET);
-        updateKernels();
+        AbstractNameQuery query = new AbstractNameQuery(null, map,
+                Collections.EMPTY_SET);
         for (int i = 0; i < kernels.size(); i++) {
             Set beans = kernels.get(i).listGBeans(query);
             for (Iterator it = beans.iterator(); it.hasNext();) {
@@ -284,68 +373,53 @@
         return result;
     }
 
-    protected void updateKernels() {
-        kernels = new ArrayList<Kernel>();
-        IServer[] runningServers = ServerCore.getServers();
-        for (int i = 0; i < runningServers.length; i++) {
-            try {
-                GeronimoServerBehaviourDelegate delegate = (GeronimoServerBehaviourDelegate)
runningServers[i]
-                        .getAdapter(GeronimoServerBehaviourDelegate.class);
-                if (delegate != null) {
-                    MBeanServerConnection connection = delegate.getServerConnection();
-                    if (connection != null) {
-                        kernels.add(new KernelDelegate(connection));
-                    }
-                }
-            } catch (SecurityException e) {
-            } catch (Exception e) {
-                Trace.trace(Trace.WARNING, "Kernel connection failed. " + e.getMessage());
-            }
-        }
-    }
-
     protected void printNamingPatternList(List<Pattern> patternList) {
         for (int i = 0; i < patternList.size(); i++) {
             Pattern pattern = patternList.get(i);
-            System.out.println("ArtifactID:" + pattern.getArtifactId() + " GroupID:"
-                    + pattern.getGroupId() + " Module:" + pattern.getModule() + " Version:"
-                    + pattern.getVersion() + " Name:" + pattern.getName());
+            System.out.println("ArtifactID:" + pattern.getArtifactId()
+                    + " GroupID:" + pattern.getGroupId() + " Module:"
+                    + pattern.getModule() + " Version:" + pattern.getVersion()
+                    + " Name:" + pattern.getName());
         }
     }
 
-    protected void printDeploymentPatternList(List<org.apache.geronimo.jee.deployment.Pattern>
patternList) {
+    protected void printDeploymentPatternList(
+            List<org.apache.geronimo.jee.deployment.Pattern> patternList) {
         for (int i = 0; i < patternList.size(); i++) {
-            org.apache.geronimo.jee.deployment.Pattern pattern = patternList.get(i);
-            System.out.println("ArtifactID:" + pattern.getArtifactId() + " GroupID:"
-                    + pattern.getGroupId() + " Module:" + pattern.getVersion() + " Version:"
-                    + pattern.getType() + " Name:" + pattern.getCustomFoo());
+            org.apache.geronimo.jee.deployment.Pattern pattern = patternList
+                    .get(i);
+            System.out.println("ArtifactID:" + pattern.getArtifactId()
+                    + " GroupID:" + pattern.getGroupId() + " Module:"
+                    + pattern.getVersion() + " Version:" + pattern.getType()
+                    + " Name:" + pattern.getCustomFoo());
         }
     }
 
     protected void printDependencies(List<Dependency> dependencyList) {
         for (int i = 0; i < dependencyList.size(); i++) {
             Dependency dependency = dependencyList.get(i);
-            System.out.println("ArtifactID:" + dependency.getArtifactId() + " GroupID:"
-                    + dependency.getGroupId() + " Type:" + dependency.getType() + " Version:"
+            System.out.println("ArtifactID:" + dependency.getArtifactId()
+                    + " GroupID:" + dependency.getGroupId() + " Type:"
+                    + dependency.getType() + " Version:"
                     + dependency.getVersion());
         }
     }
 
-    public void testGeronimoServerInfo() {
+    public void printServerInfo() {
         System.out.println("EJB Modules: \n");
-        List<Pattern> ejbModules = getDeployedEJBs();
+        List<Pattern> ejbModules = getDeployedEjbs();
         printNamingPatternList(ejbModules);
         System.out.println("\n\nSecurity Realms: \n");
         List<String> securityRealms = getSecurityRealms();
         System.out.println(securityRealms.toString());
         System.out.println("\n\nJMS Connection Factories: \n");
-        List<Pattern> jmsConnectionFactories = getJMSConnectionFactories();
+        List<Pattern> jmsConnectionFactories = getJmsConnectionFactories();
         printNamingPatternList(jmsConnectionFactories);
         System.out.println("\n\nJMS Destinations: \n");
-        List<Pattern> jmsDestinations = getJMSDestinations();
+        List<Pattern> jmsDestinations = getJmsDestinations();
         printNamingPatternList(jmsDestinations);
         System.out.println("\n\nJDBC Connection Pools: \n");
-        List<Pattern> jdbcConnectionPools = getJDBCConnectionPools();
+        List<Pattern> jdbcConnectionPools = getJdbcConnectionPools();
         printNamingPatternList(jdbcConnectionPools);
         System.out.println("\n\nJava Mail Resources: \n");
         List<Pattern> javaMailResources = getJavaMailSessions();

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java?rev=679414&r1=679413&r2=679414&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/editors/GeronimoFormContentLoader.java
Thu Jul 24 07:13:50 2008
@@ -25,6 +25,7 @@
 import org.apache.geronimo.st.ui.CommonMessages;
 import org.apache.geronimo.st.ui.editors.AbstractGeronimoDeploymentPlanEditor;
 import org.apache.geronimo.st.ui.editors.AbstractGeronimoFormContentLoader;
+import org.apache.geronimo.st.v21.core.GeronimoServerInfo;
 import org.apache.geronimo.st.v21.core.GeronimoV21Utils;
 import org.apache.geronimo.st.v21.ui.pages.AppClientDeploymentPage;
 import org.apache.geronimo.st.v21.ui.pages.AppClientGeneralPage;
@@ -37,6 +38,10 @@
 import org.apache.geronimo.st.v21.ui.pages.SecurityPage;
 import org.apache.geronimo.st.v21.ui.pages.WebGeneralPage;
 import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.forms.editor.FormEditor;
 
@@ -124,4 +129,15 @@
     private DeploymentPage createDeploymentFormPage(FormEditor editor) {
         return new DeploymentPage(editor, "deploymentpage", CommonMessages.editorTabDeployment);
     }
+
+    public void triggerGeronimoServerInfoUpdate() throws PartInitException {
+        Job job = new Job("ServeInfoGetter"){
+            protected IStatus run(IProgressMonitor arg0) {
+                GeronimoServerInfo.getInstance().updateInfo();
+                return Status.OK_STATUS;
+            }
+        };
+        job.setPriority(Job.SHORT);
+        job.schedule();
+    }
 }



Mime
View raw message