|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.tomcat5.nodes; import java.util.Comparator; import javax.enterprise.deploy.spi.DeploymentManager; import javax.enterprise.deploy.spi.TargetModuleID; import javax.enterprise.deploy.spi.status.ProgressListener; import javax.enterprise.deploy.spi.status.ProgressObject; import javax.enterprise.deploy.shared.StateType; import javax.enterprise.deploy.shared.CommandType; import org.netbeans.modules.tomcat5.TomcatModule; import org.netbeans.modules.tomcat5.nodes.actions.TomcatWebModuleCookie; import org.openide.awt.StatusDisplayer; import org.openide.nodes.Children; import org.openide.nodes.Node; import org.openide.util.NbBundle; import org.openide.util.RequestProcessor; import org.openide.NotifyDescriptor; import org.openide.DialogDisplayer; import javax.enterprise.deploy.spi.status.ProgressEvent; import javax.enterprise.deploy.spi.status.DeploymentStatus; import java.io.*; import org.netbeans.modules.tomcat5.*; /** * * @author Petr Pisl */ public class TomcatWebModule implements TomcatWebModuleCookie { /** path to context.xml */ private static final String CONTEXT_XML_PATH = File.separator + "META-INF" + File.separator + "context.xml"; // NOI18N private final TomcatModule tomcatModule; private final TomcatManager manager; private boolean isRunning; private Node node; private final TargetModuleID[] target; /** Creates a new instance of TomcatWebModule */ public TomcatWebModule(DeploymentManager manager, TomcatModule tomcatModule, boolean isRunning) { this.tomcatModule = tomcatModule; this.manager = (TomcatManager)manager; this.isRunning = isRunning; target = new TargetModuleID[]{tomcatModule}; } public TomcatModule getTomcatModule () { return tomcatModule; } public void setRepresentedNode(Node node){ this.node = node; } public Node getRepresentedNode (){ return node; } public DeploymentManager getDeploymentManager() { return manager; } public void undeploy() { RequestProcessor.getDefault().post(new Runnable() { public void run () { StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(TomcatWebModule.class, "MSG_START_UNDEPLOY", // NOI18N new Object []{getTomcatModule ().getPath()})); ProgressObject po = manager.undeploy(target); po.addProgressListener(new TomcatProgressListener()); } }, 0); } public void start() { RequestProcessor.getDefault().post(new Runnable() { public void run () { StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(TomcatWebModule.class, "MSG_START_STARTING", // NOI18N new Object []{getTomcatModule ().getPath()})); ProgressObject po = manager.start(target); po.addProgressListener(new TomcatProgressListener()); } }, 0); } public void stop() { RequestProcessor.getDefault().post(new Runnable() { public void run () { StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(TomcatWebModule.class, "MSG_START_STOPPING", // NOI18N new Object []{getTomcatModule ().getPath()})); ProgressObject po = manager.stop(target); po.addProgressListener(new TomcatProgressListener()); } }, 0); } public boolean isRunning() { return isRunning; } private String constructDisplayName(){ if (isRunning()) return getTomcatModule ().getPath(); else return getTomcatModule ().getPath() + " [" + NbBundle.getMessage(TomcatWebModuleNode.class, "LBL_Stopped") // NOI18N + "]"; } /** * Opens the log file defined for this web moudel in the ouput window. */ public void openLog() { manager.logManager().openContextLog(tomcatModule); } /** * Returns |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.