1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/compapp.help/build.xml Fri Oct 20 12:37:37 2006 +0000
1.3 @@ -0,0 +1,28 @@
1.4 +<?xml version="1.0" encoding="UTF-8"?>
1.5 +
1.6 +<!--
1.7 +The contents of this file are subject to the terms of the Common Development
1.8 +and Distribution License (the License). You may not use this file except in
1.9 +compliance with the License.
1.10 +
1.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
1.12 +or http://www.netbeans.org/cddl.txt.
1.13 +
1.14 +When distributing Covered Code, include this CDDL Header Notice in each file
1.15 +and include the License file at http://www.netbeans.org/cddl.txt.
1.16 +If applicable, add the following below the CDDL Header, with the fields
1.17 +enclosed by brackets [] replaced by your own identifying information:
1.18 +"Portions Copyrighted [year] [name of copyright owner]"
1.19 +
1.20 + The Original Software is NetBeans. The Initial Developer of the Original
1.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
1.22 + Microsystems, Inc. All Rights Reserved.
1.23 +-->
1.24 +
1.25 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
1.26 +<!-- for some information on what you could do (e.g. targets to override). -->
1.27 +<!-- If you delete this file and reopen the project it will be recreated. -->
1.28 +<project name="org.netbeans.modules.compapp.capshelp" default="netbeans" basedir=".">
1.29 + <description>Builds, tests, and runs the project org.netbeans.modules.compapp.capshelp.</description>
1.30 + <import file="nbproject/build-impl.xml"/>
1.31 +</project>
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/basics/about.html Fri Oct 20 12:37:37 2006 +0000
2.3 @@ -0,0 +1,58 @@
2.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2.5 +<!--
2.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
2.7 +* Use is subject to license terms.
2.8 +-->
2.9 +<html>
2.10 +<head>
2.11 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
2.12 +<title>About Composite Application Projects</title>
2.13 +</head>
2.14 +<body>
2.15 +<h2>About Composite Application Projects</h2>
2.16 +<p><small><a href="#seealso">See Also</a></small></p>
2.17 +<p>A Composite Application project is used to create a Service Assembly
2.18 +that can be deployed to the Java Business Integration (JBI) server.
2.19 +Within the Composite Application project, you can:</p>
2.20 +<ul>
2.21 + <li>Assemble an application that uses multiple project types (BPEL, XSLT, and so forth).</li>
2.22 + <li>Configure external/edge access protocols (SOAP, JMS, SMTP, and others).</li>
2.23 + <li>Build JBI deployment packages.</li>
2.24 + <li>Deploy the application image to the target JBI server.</li>
2.25 + <li>Monitor the status of JBI server components and applications.</li>
2.26 +</ul>
2.27 +<p>The JBI server can contain different service engines.
2.28 + One service engine is the BPEL Service Engine runtime.
2.29 + For a Composite Application project to be deployed to the BPEL SE runtime,
2.30 + it must include a JBI module created from a BPEL Module project.
2.31 + Within a Composite Application Project that includes a JBI module,
2.32 + you can also create and execute test cases that can then be run, in JUnit fashion,
2.33 + against the deployed BPEL processes.</p>
2.34 +<p>Three samples are supplied, illustrating the relationship between
2.35 + BPEL Module projects and Composite Application projects.
2.36 + See <a href="nbdocs://org.netbeans.modules.bpel.bpelhelp/org/netbeans/modules/bpel/bpelhelp/basics/create_sample.html" title="Creating Sample Processes in the BPEL Designer">Creating Sample Processes in the BPEL Designer</a>.</p>
2.37 +<p>The pop-up menu of a Composite Application project contains major commands you can run on this type of projects, such as: </p>
2.38 +<ul>
2.39 + <li><a href="add_jbi_module.html" title="Adding JBI Modules to Composite Application Projects">Add JBI Module</a>. Adds a BPEL Module project to the Composite Application project. You must do this to deploy and test-run your business application. </li>
2.40 + <li>Build, clean and build, or clean the project. </li>
2.41 + <li><a href="deploy_project.html" title="Deploying Composite Application Projects">Deploy Project</a>. Compiles the Composite Application project and deploys it to the BPEL Service Engine runtime. </li>
2.42 + <li><a href="jbi_tester.html" title="Performing Test Runs">Test Project</a>. Runs test cases against this Composite Application project. </li>
2.43 + <li><a href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/project/proj_main.html">Set Main Project</a></li>
2.44 + <li>Delete the project.</li>
2.45 + <li>Configure project properties, such as the project location in the filesystem, descriptions of the Assembly Unit and Application Sub Assembly, target engine, binding, and deployment components, and the server to which the project is deployed. To configure project properties, right-click the project's node and choose Properties. </li>
2.46 +</ul>
2.47 +<dl>
2.48 +<dt><a name="seealso">See Also</a></dt>
2.49 +<dd><a href="nbdocs://org.netbeans.modules.bpel.bpelhelp/org/netbeans/modules/bpel/bpelhelp/test_run/about.html" title="Deploying and Performing Test Runs of BPEL Processes">Deploying and Performing Test Runs of BPEL Processes</a></dd>
2.50 +<dd><a href="nbdocs://org.netbeans.modules.bpel.bpelhelp/org/netbeans/modules/bpel/bpelhelp/basics/project_lifecycle.html" title="Understanding Service Oriented Architecture Projects">Understanding Service Oriented Architecture Projects</a></dd>
2.51 +<dd><a href="create_project.html" title="Creating Composite Application Projects">Creating Composite Application Projects</a></dd>
2.52 +</dl>
2.53 +<hr>
2.54 +<small><a href="../credits.html">Legal Notices</a></small>
2.55 +<table border="0" cellpadding="150">
2.56 +<tr><td> </td></tr>
2.57 +<tr><td> </td></tr>
2.58 +<tr><td> </td></tr>
2.59 +</table>
2.60 +</body>
2.61 +</html>
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/basics/add_jbi_module.html Fri Oct 20 12:37:37 2006 +0000
3.3 @@ -0,0 +1,35 @@
3.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3.5 +<!--
3.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
3.7 +* Use is subject to license terms.
3.8 +-->
3.9 +<html>
3.10 +<head>
3.11 +<title>Adding JBI Modules to Composite Application Projects</title>
3.12 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
3.13 +</head>
3.14 +<body>
3.15 +<h2>Adding JBI Modules to Composite Application Projects</h2>
3.16 +<p><small><a href="#seealso">See Also</a></small></p>
3.17 +<p><b>To add a JBI Module project to the Composite Application project:</b></p>
3.18 +<ol>
3.19 + <li>In the Projects window, right-click the Composite Application project's node and choose Add JBI Module.</li>
3.20 + <li>In the Select Project dialog box, select the BPEL Module project folder, make sure that the project's JAR file has appeared in the Project JAR Files list, and click Add Project JAR Files. <br>
3.21 + To verify that the JBI Module has appeared, in the Projects window, expand Composite Application project > JBI Modules. You should see the JAR file of the BPEL Module project. </li>
3.22 +</ol>
3.23 +
3.24 +<dl>
3.25 +<dt><a name="seealso">See Also</a></dt>
3.26 +<dd><a href="nbdocs://org.netbeans.modules.bpel.bpelhelp/org/netbeans/modules/bpel/bpelhelp/basics/project_lifecycle.html" title="Understanding Service Oriented Architecture Projects">Understanding Service Oriented Architecture Projects</a></dd>
3.27 +<dd><a href="../basics/create_project.html" title="Creating Composite Application Projects">Creating Composite Application Projects</a></dd>
3.28 +</dl>
3.29 +<hr>
3.30 +<small>
3.31 +<a href="../credits.html">Legal Notices</a></small>
3.32 +<table border="0" cellpadding="150">
3.33 +<tr><td> </td></tr>
3.34 +<tr><td> </td></tr>
3.35 +<tr><td> </td></tr>
3.36 +</table>
3.37 +</body>
3.38 +</html>
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/basics/caps_project_basic_create.html Fri Oct 20 12:37:37 2006 +0000
4.3 @@ -0,0 +1,38 @@
4.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4.5 +<!--
4.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
4.7 +* Use is subject to license terms.
4.8 +-->
4.9 +<html>
4.10 +<head>
4.11 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
4.12 +<title>New Composite Application Project Wizard: Name and Location</title>
4.13 +</head>
4.14 +<body>
4.15 +<h2>New Composite Application Project Wizard: Name and Location</h2>
4.16 +<p><small><a href="#seealso">See Also</a></small></p>
4.17 +<p>The New Project wizard steps you through the process of creating a new project.
4.18 + You open the wizard by opening the New Project wizard and selecting the Composite Application project template from the Service Oriented Architecture category.
4.19 +<p>The Name and Location page of the wizard prompts you to supply information
4.20 + characterizing the Composite Application project you are creating:</p>
4.21 +<ul>
4.22 + <li><b>Project Name.</b> Supply a name for the folder that will contain your Composite Application files. </li>
4.23 + <li><b>Project Location.</b> Keep the default path to your other projects, or specify a new one. </li>
4.24 + <li>Project Folder <em>(not settable).</em> The system derives this value by concatenating the previous two entries. </li>
4.25 + <li><b>Set as Main Project.</b> Keep this check box selected unless you want a different project to be regarded as the main project</a>.</li>
4.26 +</ul>
4.27 +<p> When you click Finish, the project is created on your computer and opened
4.28 + in both the Projects window and the Files window.</p>
4.29 +<dt><a name="seealso">See Also</a></dt>
4.30 +<dd><a href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/project/proj_main.html" title="Set Main Project">Set Main Project</a>.</dd>
4.31 +<dd><a href="../basics/create_project.html" title="Creating Composite Application Projects">Creating Composite Application Projects</a>.</dd>
4.32 +</dl>
4.33 +<hr>
4.34 +<small><a href="../credits.html">Legal Notices</a></small>
4.35 +<table border="0" cellpadding="150">
4.36 +<tr><td> </td></tr>
4.37 +<tr><td> </td></tr>
4.38 +<tr><td> </td></tr>
4.39 +</table>
4.40 +</body>
4.41 +</html>
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/basics/create_project.html Fri Oct 20 12:37:37 2006 +0000
5.3 @@ -0,0 +1,39 @@
5.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
5.5 +<!--
5.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5.7 +* Use is subject to license terms.
5.8 +-->
5.9 +<html>
5.10 +<head>
5.11 +<title>Creating Composite Application Projects</title>
5.12 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
5.13 +</head>
5.14 +<body>
5.15 +<h2>Creating Composite Application Projects</h2>
5.16 +<p><small><a href="#seealso">See Also</a></small></p>
5.17 +<p>The New Project wizard guides you through the steps needed to create a Composite Application project. </p>
5.18 +<p><b>To create a new Composite Application project:</b></p>
5.19 +<ol>
5.20 + <li>Choose File > New
5.21 + Project (Ctrl-Shift-N).</li>
5.22 + <li>In the Categories list, select Service Oriented Architecture and in the Projects list, select Composite Application and click Next.</li>
5.23 + <li>In the Name and Location page, name the project and specify the location of project files.</li>
5.24 + <li>To set the new Composite Application project as main, leave the Set as Main Project checkbox selected. </li>
5.25 + <li>Click Finish. <br>
5.26 + The new Composite Application project appears in the Projects window. To be able to deploy and test-run your business process, <a href="add_jbi_module.html">add a JBI module</a> to the Composite Application project.</li>
5.27 +</ol>
5.28 +<dl>
5.29 + <dt><a name="seealso">See Also</a></dt>
5.30 + <dd><a href="about.html" title="About Composite Applications">About Composite Application Projects</a></dd>
5.31 + <dd><a href="nbdocs://org.netbeans.modules.bpel.bpelhelp/org/netbeans/modules/bpel/bpelhelp/basics/project_lifecycle.html" title="Understanding Service Oriented Architecture Projects">Understanding Service Oriented Architecture Projects</a></dd>
5.32 +</dl>
5.33 +<hr>
5.34 +<small>
5.35 +<a href="../credits.html">Legal Notices</a></small>
5.36 +<table border="0" cellpadding="150">
5.37 +<tr><td> </td></tr>
5.38 +<tr><td> </td></tr>
5.39 +<tr><td> </td></tr>
5.40 +</table>
5.41 +</body>
5.42 +</html>
5.43 \ No newline at end of file
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/basics/deploy_project.html Fri Oct 20 12:37:37 2006 +0000
6.3 @@ -0,0 +1,40 @@
6.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
6.5 +<!--
6.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
6.7 +* Use is subject to license terms.
6.8 +-->
6.9 +<html>
6.10 +<head>
6.11 +<title>Deploying Composite Application Projects </title>
6.12 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
6.13 +</head>
6.14 +<body>
6.15 +<h2>Deploying Composite Application Projects </h2>
6.16 +<p><small><a href="#seealso">See Also</a></small></p>
6.17 +<p>Before you can <a href="jbi_tester.html">test-run</a> a business process,
6.18 +make sure that you have <a href="nbdocs://org.netbeans.modules.j2ee.platform/org/netbeans/modules/j2ee/platform/docs/server/server_start.html" title="Starting and Stopping a Server">started the Application Server</a>, <a href="nbdocs://org.netbeans.modules.bpel.bpelhelp/org/netbeans/modules/bpel/bpelhelp/test_run/build_project.html" title="Building BPEL Module Projects">built the BPEL Module project</a>, and <a href="add_jbi_module.html" title="Adding JBI Modules to Composite Application Projects">added</a> it to a Composite Application project as a JBI module. </p>
6.19 +<p><b>To deploy a Composite Application project to the JBI server:</b> </p>
6.20 +<ul>
6.21 +<li>
6.22 + In the Projects window, right-click the Composite Application project's node and choose
6.23 + Deploy Project. </li>
6.24 +</ul>
6.25 +<p>The Deploy action compiles the files in the Composite Application project, packages
6.26 +the compiled BPEL and related web service artifacts (<tt>.wsdl</tt> and <tt>.xsd</tt> files), and deploys them to the BPEL Service Engine. </p>
6.27 +<p>To verify that the project has been successfully deployed to the BPEL Service Engine, open the Runtime window, expand the JBI node, right-click the Service Assemblies node, and choose Refresh. You should see the name of the Composite Application project for the deployed Service Assembly. </p>
6.28 +<dl>
6.29 +<dt><a name="seealso">See Also</a></dt>
6.30 +<dd><a href="add_jbi_module.html" title="Adding JBI Modules to Composite Application Projects">Adding JBI Modules to Composite Application Projects</a></dd>
6.31 +<dd><a href="nbdocs://org.netbeans.modules.bpel.bpelhelp/org/netbeans/modules/bpel/bpelhelp/test_run/about.html" title="Deploying and Performing Test Runs of BPEL Processes">Deploying and Performing Test Runs of BPEL Processes</a></dd>
6.32 +</dl>
6.33 +<hr>
6.34 +<small>
6.35 +<a href="../credits.html">Legal Notices</a></small>
6.36 +<table border="0" cellpadding="150">
6.37 +<tr><td> </td></tr>
6.38 +<tr><td> </td></tr>
6.39 +<tr><td> </td></tr>
6.40 +</table>
6.41 +</body>
6.42 +</html>
6.43 +
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/basics/jbi.html Fri Oct 20 12:37:37 2006 +0000
7.3 @@ -0,0 +1,45 @@
7.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
7.5 +<!--
7.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
7.7 +* Use is subject to license terms.
7.8 +-->
7.9 +<html>
7.10 +<head>
7.11 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
7.12 +<title>Java Business Integration (JBI)</title>
7.13 +</head>
7.14 +<body>
7.15 +<h2>Java Business Integration (JBI)</h2>
7.16 +<p><small><a href="#seealso">See Also</a></small></p>
7.17 +<p>The JBI framework implements Java Specification Request
7.18 + (JSR) 208 to provide the foundation of integration and
7.19 +service-oriented architecture (SOA) solutions.</p>
7.20 +<p>This framework provides the following:</p>
7.21 +<ul>
7.22 + <li><b>JBI pluggability.</b> An open, extensible,
7.23 + pluggable platform that enables the collaboration of
7.24 + integration technology (such as business process engines,
7.25 + document transform engines, B2B management, and business rules)
7.26 + with Web services.</li>
7.27 + <li><b>JBI Service Assembly. </b>A single
7.28 + standard document describing the routing, artifacts,
7.29 + and services that make up an SOA application.
7.30 + You can think of a Service Assembly as an SOA
7.31 + "super <tt>.jar</tt> file" that packages together the
7.32 + individual Service Units, modules, and configurations
7.33 + into a single deployable entity.</li>
7.34 +</ul>
7.35 +<dl>
7.36 +<dt><a name="seealso">See Also</a></dt>
7.37 +<dd><a href="jbi_tester.html" title="Testing a JBI Project">Testing a JBI Project</a></dd>
7.38 +<dd><a href="../jbinode/caps_jbi_node_RuntimeFunctionality.html" title="JBI Nodes: Runtime Functionality">JBI Nodes: Runtime Functionality</a></dd>
7.39 +</dl>
7.40 +<hr>
7.41 +<small><a href="../credits.html">Legal Notices</a></small>
7.42 +<table border="0" cellpadding="150">
7.43 +<tr><td> </td></tr>
7.44 +<tr><td> </td></tr>
7.45 +<tr><td> </td></tr>
7.46 +</table>
7.47 +</body>
7.48 +</html>
7.49 \ No newline at end of file
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/basics/jbi_tester.html Fri Oct 20 12:37:37 2006 +0000
8.3 @@ -0,0 +1,70 @@
8.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
8.5 +<!--
8.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
8.7 +* Use is subject to license terms.
8.8 +-->
8.9 +<html>
8.10 +<head>
8.11 +<title>Testing a JBI Project</title>
8.12 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
8.13 +</head>
8.14 +<body>
8.15 +<h2>Testing a JBI Project</h2>
8.16 +<p><small><a href="#seealso">See Also</a></small></p>
8.17 +<p>You can enhance a JBI deployment project by adding one or more test cases.</p>
8.18 +<h3>Creating and Running Test Cases</h3>
8.19 +<p>In order to obtain test results you must do the following:
8.20 +<ol>
8.21 + <li><a href="jbi_tester_adding_test.html" title="Adding/Binding a Test Case">Add a test case and bind it to a BPEL operation</a></li>
8.22 + <li><a href="jbi_tester_setting_props.html" title="Setting Test Properties">Set the test properties</a></li>
8.23 + <li><a href="jbi_tester_customizing_input.html" title="Customizing Test Input">Customize test input</a></li>
8.24 + <li><a href="jbi_tester_running_tester.html" title="Running the Tester">Run the Tester</a></li>
8.25 +</ol>
8.26 +<ul class="note">
8.27 + <li>All steps in this section assume the following:</li>
8.28 + <ul>
8.29 + <li>You have already created a BPEL Module project containing
8.30 + a .wsdl file that codes an operation you want to test.</li>
8.31 + <li>You have successfully built your BPEL Module project.</li>
8.32 + <li>You have added your BPEL Module project to a Composite Application project as a JBI Module.</li>
8.33 + </ul>
8.34 +</ul>
8.35 +<h3>Looking at Test Case Results</h3>
8.36 +<ul>
8.37 + <li>The first run correctly reports that it failed:
8.38 + The output produced does not match the (empty) <tt>Output.xml</tt> file,
8.39 + and the file’s null content is replaced with the output of the first run. </li>
8.40 + <li>If you run the test again without changing the input,
8.41 + second and subsequent runs report success,
8.42 + since the output matches the contents of <tt>Output.xml</tt>. </li>
8.43 + <li>If you change the value in the <tt>Input.xml</tt> and re-run the test, then:</li>
8.44 + <ul>
8.45 + <li>If the feature-status property is set to progress,
8.46 + then the test indicates success even though a mismatch occurred. </li>
8.47 + <li>If the feature-status property is set to done,
8.48 + then the test indicates failure. </li>
8.49 + </ul>
8.50 + <li>If you right-click <tt>myTestcase1</tt> and click the Diff pop-up menu item,
8.51 + the window displays the difference between the latest output
8.52 + and the contents of <tt>Output.xml</tt>. </li>
8.53 +</ul>
8.54 +<p>To browse the results of past tests, you can choose from the drop-down list of
8.55 + Actual_<em>yymmddhhmmss</em>.xml files, and then click the Refresh button.</p>
8.56 +<dl>
8.57 +<dt><a name="seealso">See Also</a></dt>
8.58 +<dd><a href="nbdocs://org.netbeans.modules.j2ee.platform/org/netbeans/modules/j2ee/platform/docs/server/server_start.html" title="Starting and Stopping a Server">Starting and Stopping a Server</a></dd>
8.59 +<dd><a href="nbdocs://org.netbeans.modules.bpel.bpelhelp/org/netbeans/modules/bpel/bpelhelp/test_run/build_project.html" title="Building BPEL Module Projects">Building BPEL Module Projects</a></dd>
8.60 +<dd><a href="add_jbi_module.html" title="Adding JBI Modules to Composite Application Projects">Adding JBI Modules to Composite Application Projects</a></dd>
8.61 +<dd><a href="deploy_project.html" title="Deploying Composite Application Projects">Deploying Composite Application Projects</a></dd>
8.62 +</dl>
8.63 +<hr>
8.64 +<small>
8.65 +<a href="../credits.html">Legal Notices</a></small>
8.66 +<table border="0" cellpadding="150">
8.67 +<tr><td> </td></tr>
8.68 +<tr><td> </td></tr>
8.69 +<tr><td> </td></tr>
8.70 +</table>
8.71 +</body>
8.72 +</html>
8.73 +
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/basics/jbi_tester_adding_test.html Fri Oct 20 12:37:37 2006 +0000
9.3 @@ -0,0 +1,44 @@
9.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
9.5 +<!--
9.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
9.7 +* Use is subject to license terms.
9.8 +-->
9.9 +<html>
9.10 +<head>
9.11 +<title>Adding/Binding a Test Case</title>
9.12 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
9.13 +</head>
9.14 +<body>
9.15 +<h2>Adding/Binding a Test Case</h2>
9.16 +<p><small><a href="#seealso">See Also</a></small></p>
9.17 +<p><b>To add a test case and bind it to a BPEL operation:</b></p>
9.18 +<ol>
9.19 + <li>In the IDE Projects tab, open the Composite Application project
9.20 + to expose its Test folder.</li>
9.21 + <li>Right-click Test, and choose New Test Case from the pop-up menu.<br>
9.22 + This launches the Create New Test Case wizard.</li>
9.23 + <li>In the Enter the Test Case Name step, enter a name for the test case and click Next.</li>
9.24 + <li>In the Select the WSDL Document step, open the BPEL Module project,
9.25 + select the <tt>.wsdl</tt> file containing the operation you want to test,
9.26 + and then click Next.
9.27 + <li>In the next step, select the operation you want to test, and then click Finish.<br>
9.28 + In the project tree, under Test, a new folder is created in the form of an upper case T, containing two files: <tt>Input.xml</tt> and <tt>Output.xml</tt>.</li>
9.29 +</ol>
9.30 +<ul class="note">
9.31 + <li>If you viewed the test case in the Files tab, you would see Concurrent.properties
9.32 + as a third file.</li>
9.33 +</ul>
9.34 +<dl>
9.35 +<dt><a name="seealso">See Also</a></dt>
9.36 +<dd><a href="jbi_tester.html" title="Testing a JBI Project">Testing a JBI Project</a></dd>
9.37 +</dl>
9.38 +<hr>
9.39 +<small>
9.40 +<a href="../credits.html">Legal Notices</a></small>
9.41 +<table border="0" cellpadding="150">
9.42 +<tr><td> </td></tr>
9.43 +<tr><td> </td></tr>
9.44 +<tr><td> </td></tr>
9.45 +</table>
9.46 +</body>
9.47 +</html>
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/basics/jbi_tester_customizing_input.html Fri Oct 20 12:37:37 2006 +0000
10.3 @@ -0,0 +1,47 @@
10.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
10.5 +<!--
10.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
10.7 +* Use is subject to license terms.
10.8 +-->
10.9 +<html>
10.10 +<head>
10.11 +<title>Customizing Test Input</title>
10.12 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
10.13 +</head>
10.14 +<body>
10.15 +<h2>Customizing Test Input</h2>
10.16 +<p><small><a href="#seealso">See Also</a></small></p>
10.17 +<p><b>To customize test input:</b></p>
10.18 +<ol>
10.19 + <li>In the project tree, right-click Input.xml and click Edit.</li>
10.20 + <li>Modify its contents to your taste. For example, wherever you see <tt><value>?string?</value></tt> click within <tt>?string?</tt> and replace it with a string of any length.
10.21 + However, within such strings, do not include the characters <b><</b> (less-than sign) or <b>&</b> (ampersand)
10.22 + unless you use them with XML semantics.</li>
10.23 + <li>When you are satisfied, click Save.</li>
10.24 + <li>Right-click <tt>Output.xml</tt> and click Edit to examine its contents:
10.25 + <ul>
10.26 + <li>It is empty. This is a special state that triggers a special operation when the test is run.</li>
10.27 + <li>Each time the test is run, the current output is compared to the contents of Output.xml;
10.28 + whatever differences are detected will be stored in the
10.29 + Actual_<em>yymmddhhmmss</em>.xml
10.30 + file under the test case folder.
10.31 + However, in the special case where Output.xml starts null,
10.32 + then the output is written to the <tt>Output.xml</tt> file.</li>
10.33 + <li>In each run after the first, assuming Output.xml is no longer null, its contents are preserved.
10.34 + In other words, a previous output is never overwritten by new results.</li>
10.35 + </ul>
10.36 +</ol>
10.37 +<dl>
10.38 +<dt><a name="seealso">See Also</a></dt>
10.39 +<dd><a href="jbi_tester.html" title="Testing a JBI Project">Testing a JBI Project</a></dd>
10.40 +</dl>
10.41 +<hr>
10.42 +<small>
10.43 +<a href="../credits.html">Legal Notices</a></small>
10.44 +<table border="0" cellpadding="150">
10.45 +<tr><td> </td></tr>
10.46 +<tr><td> </td></tr>
10.47 +<tr><td> </td></tr>
10.48 +</table>
10.49 +</body>
10.50 +</html>
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/basics/jbi_tester_running_tester.html Fri Oct 20 12:37:37 2006 +0000
11.3 @@ -0,0 +1,35 @@
11.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
11.5 +<!--
11.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
11.7 +* Use is subject to license terms.
11.8 +-->
11.9 +<html>
11.10 +<head>
11.11 +<title>Running the Tester</title>
11.12 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
11.13 +</head>
11.14 +<body>
11.15 +<h2>Running the Tester</h2>
11.16 +<p><small><a href="#seealso">See Also</a></small></p>
11.17 +<p><b>To run a single test case:</b> </p>
11.18 +<ul>
11.19 + <li>In the project tree, right-click the test case folder and choose Run.</li>
11.20 +</ul>
11.21 +<b>To run all test cases in a project:</b>
11.22 +<ul>
11.23 + <li>Right-click the project and choose Test Project from the pop-up menu (or press Alt-F6).</li>
11.24 +</ul>
11.25 +<dl>
11.26 +<dt><a name="seealso">See Also</a></dt>
11.27 +<dd><a href="jbi_tester.html" title="Testing a JBI Project">Testing a JBI Project</a></dd>
11.28 +</dl>
11.29 +<hr>
11.30 +<small>
11.31 +<a href="../credits.html">Legal Notices</a></small>
11.32 +<table border="0" cellpadding="150">
11.33 +<tr><td> </td></tr>
11.34 +<tr><td> </td></tr>
11.35 +<tr><td> </td></tr>
11.36 +</table>
11.37 +</body>
11.38 +</html>
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
12.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/basics/jbi_tester_setting_props.html Fri Oct 20 12:37:37 2006 +0000
12.3 @@ -0,0 +1,74 @@
12.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
12.5 +<!--
12.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
12.7 +* Use is subject to license terms.
12.8 +-->
12.9 +<html>
12.10 +<head>
12.11 +<title>Setting the Test Properties</title>
12.12 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
12.13 +</head>
12.14 +<body>
12.15 +<h2>Setting the Test Properties</h2>
12.16 +<p><small><a href="#seealso">See Also</a></small></p>
12.17 +<p><b>To set the test properties:</b></p>
12.18 +<ol>
12.19 + <li>Right-click the test case and choose pop-menu item Properties.</li>
12.20 + <li>Set the properties of the test case as follows:</li>
12.21 + <dl>
12.22 + <dt><strong>Description</strong>: string</dt>
12.23 + <dd>User-entered text to help user know what the test is about.</dd>
12.24 + <dt><strong>Destination</strong>: URL
12.25 + (from the <tt>.wsdl</tt> file's <tt><soap:address location="THIS"></tt> tag)</dt>
12.26 + <dd>Identifies the location of the web service to be tested.</dd>
12.27 + <dt><strong>SoapAction</strong> (default: blank)</dt>
12.28 + <dd></dd>
12.29 + <dt><strong>Input File</strong> (read-only; generated by system)</dt>
12.30 + <dd>Name of input file.</dd>
12.31 + <dt><strong>Output File</strong> (read-only; generated by system)</dt>
12.32 + <dd>Name of output file.</dd>
12.33 + <dt><strong>Concurrent Threads</strong>: integer; default = 1</dt>
12.34 + <dd>Each thread can invoke the test case multiple times (see the following property).
12.35 + Thus, if conc=2 and inv=3, the test case will be run 6 times
12.36 + (two threads, each run thrice).</dd>
12.37 + <dt><strong>Invokes Per Thread</strong> : integer; default = 1</dt>
12.38 + <dd>Number of times each thread invokes the test case.</dd>
12.39 + <dt><strong>Test Timeout(sec)</strong>: integer; default = 30</dt>
12.40 + <dd>How long each thread has to finish.
12.41 + If it does not finish in the allotted time, then an exception is thrown.</dd>
12.42 + <dt><strong>Calculate Throughput</strong>: boolean</dt>
12.43 + <dd>If the checkbox is selected, then throughput statistics are calculated.
12.44 + Example: If a test specifies two threads and three invokes per thread,
12.45 + and if the test takes 15 seconds for the 6 invocations, then
12.46 + the statistics report an average of 2.5 seconds each.</dd>
12.47 + <dt><strong>Comparison Type</strong>: drop-down list:</dt>
12.48 + <dd>
12.49 + <ul>
12.50 + <li>identical: Considers the output and actual output as a stream of characters.
12.51 + <li>binary: Considers the output and actual output as a stream of bytes.
12.52 + <li>equals: Considers the output and actual output as a XML documents.
12.53 + </ul>
12.54 + </dd>
12.55 + <dt><strong>Feature Status</strong> : pull-down list:</dt>
12.56 + <dd>
12.57 + <ul>
12.58 + <li>progress: Marks test completion as "success", regardless of actual outcome.
12.59 + <li>done: Records actual outcome of test.
12.60 + </ul>
12.61 + </dd>
12.62 + </dl>
12.63 +</ol>
12.64 +<dl>
12.65 +<dt><a name="seealso">See Also</a></dt>
12.66 +<dd><a href="jbi_tester.html" title="Testing a JBI Project">Testing a JBI Project</a></dd>
12.67 +</dl>
12.68 +<hr>
12.69 +<small>
12.70 +<a href="../credits.html">Legal Notices</a></small>
12.71 +<table border="0" cellpadding="150">
12.72 +<tr><td> </td></tr>
12.73 +<tr><td> </td></tr>
12.74 +<tr><td> </td></tr>
12.75 +</table>
12.76 +</body>
12.77 +</html>
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
13.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/capshelp-idx.xml Fri Oct 20 12:37:37 2006 +0000
13.3 @@ -0,0 +1,24 @@
13.4 +<?xml version='1.0' encoding='ISO-8859-1'?>
13.5 +<!DOCTYPE index PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Index Version 2.0//EN"
13.6 + "http://java.sun.com/products/javahelp/index_2_0.dtd">
13.7 +
13.8 +<index version="2.0">
13.9 + <indexitem text="Composite Application projects">
13.10 + <indexitem text="about" target="org.netbeans.modules.compapp.projects.jbi.ui.JbiLogicalViewProvider" />
13.11 + <indexitem text="adding as JBI modules" target="caps_basics_add_jbi" />
13.12 + <indexitem text="creating" target="caps_basics_create" />
13.13 + <indexitem text="deploying" target="caps_basics_deploy" />
13.14 + </indexitem>
13.15 + <indexitem text="Java Business Integration (JBI)">
13.16 + <indexitem text="about" target="caps_basics_jbi" />
13.17 + <indexitem text="JBI nodes, in Runtime window" target="org.netbeans.modules.sun.manager.jbi.nodes.JBINode" />
13.18 + <indexitem text="runtime functionality" target="caps_jbi_runtime_function" />
13.19 + </indexitem>
13.20 + <indexitem text="testing, JBI modules">
13.21 + <indexitem text="about" target="caps_jbi_tester" />
13.22 + <indexitem text="adding test cases" target="caps_jbi_tester_adding_test" />
13.23 + <indexitem text="running tests" target="caps_jbi_tester_running_tester" />
13.24 + <indexitem text="test input, customizing" target="caps_jbi_tester_customizing_input" />
13.25 + <indexitem text="test properties, configuring" target="caps_jbi_tester_setting_props" />
13.26 + </indexitem>
13.27 +</index>
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
14.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/capshelp-map.jhm Fri Oct 20 12:37:37 2006 +0000
14.3 @@ -0,0 +1,28 @@
14.4 +<?xml version='1.0' encoding='ISO-8859-1'?>
14.5 +<!DOCTYPE map PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Map Version 1.0//EN"
14.6 + "http://java.sun.com/products/javahelp/map_1_0.dtd">
14.7 +
14.8 +<map version="1.0">
14.9 + <mapID target="caps_basics_jbi" url="basics/jbi.html"/>
14.10 + <mapID target="caps_credits" url="credits.html"/>
14.11 + <mapID target="org.netbeans.modules.compapp.projects.jbi.ui.JbiLogicalViewProvider" url="basics/about.html"/>
14.12 + <mapID target="org.netbeans.modules.compapp.projects.jbi.ui.wizards.NewJbiProjectWizardIterator" url="basics/caps_project_basic_create.html"/>
14.13 + <mapID target="org.netbeans.modules.compapp.projects.jbi.ui.wizards.PanelConfigureProject" url="basics/caps_project_basic_create.html"/>
14.14 + <mapID target="org.netbeans.modules.compapp.projects.jbi.ui.customizer.CustomizerGeneral" url="properties/caps_project_props.html"/>
14.15 + <mapID target="org.netbeans.modules.compapp.projects.jbi.ui.customizer.CustomizerJarContent" url="properties/caps_project_props.html"/>
14.16 + <mapID target="org.netbeans.modules.compapp.projects.jbi.ui.customizer.CustomizerRun" url="properties/caps_project_props.html"/>
14.17 + <mapID target="org.netbeans.modules.sun.manager.jbi.nodes.JBINode" url="jbinode/caps_jbi_node.html"/>
14.18 + <mapID target="org.netbeans.modules.sun.manager.jbi.nodes.JBIComponentContainerNode$SharedLibraries" url="jbinode/caps_jbi_node_SharedLibraries.html"/>
14.19 + <mapID target="org.netbeans.modules.sun.manager.jbi.nodes.JBIComponentContainerNode$ServiceEngines" url="jbinode/caps_jbi_node_ServiceEngines.html"/>
14.20 + <mapID target="org.netbeans.modules.sun.manager.jbi.nodes.JBIComponentContainerNode$BindingComponents" url="jbinode/caps_jbi_node_BindingComponents.html"/>
14.21 + <mapID target="org.netbeans.modules.sun.manager.jbi.nodes.JBIServiceAssembliesNode" url="jbinode/caps_jbi_node_ServiceAssemblies.html"/>
14.22 + <mapID target="caps_jbi_runtime_function" url="jbinode/caps_jbi_node_RuntimeFunctionality.html"/>
14.23 + <mapID target="caps_basics_create" url="basics/create_project.html"/>
14.24 + <mapID target="caps_basics_deploy" url="basics/deploy_project.html"/>
14.25 + <mapID target="caps_basics_add_jbi" url="basics/add_jbi_module.html"/>
14.26 + <mapID target="caps_jbi_tester" url="basics/jbi_tester.html"/>
14.27 + <mapID target="caps_jbi_tester_adding_test" url="basics/jbi_tester_adding_test.html"/>
14.28 + <mapID target="caps_jbi_tester_customizing_input" url="basics/jbi_tester_customizing_input.html"/>
14.29 + <mapID target="caps_jbi_tester_running_tester" url="basics/jbi_tester_running_tester.html"/>
14.30 + <mapID target="caps_jbi_tester_setting_props" url="basics/jbi_tester_setting_props.html"/>
14.31 +</map>
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
15.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/capshelp-toc.xml Fri Oct 20 12:37:37 2006 +0000
15.3 @@ -0,0 +1,23 @@
15.4 +<?xml version='1.0' encoding='ISO-8859-1'?>
15.5 +<!DOCTYPE toc PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 2.0//EN"
15.6 + "http://java.sun.com/products/javahelp/toc_2_0.dtd">
15.7 +
15.8 +<toc version="2.0">
15.9 + <tocitem text="Composite Applications">
15.10 + <tocitem text="About Composite Application Projects" target="org.netbeans.modules.compapp.projects.jbi.ui.JbiLogicalViewProvider" />
15.11 + <tocitem text="Working with Composite Application Projects">
15.12 + <tocitem text="Creating Composite Application Projects" target="caps_basics_create" />
15.13 + <tocitem text="Adding JBI Modules to Composite Application Projects" target="caps_basics_add_jbi" />
15.14 + <tocitem text="Deploying Composite Application Projects" target="caps_basics_deploy" />
15.15 + </tocitem>
15.16 + <tocitem text="Testing a JBI Project" target="caps_jbi_tester">
15.17 + <tocitem text="Adding/Binding a Test Case" target="caps_jbi_tester_adding_test" />
15.18 + <tocitem text="Setting the Test Properties" target="caps_jbi_tester_setting_props" />
15.19 + <tocitem text="Customizing Test Input" target="caps_jbi_tester_customizing_input" />
15.20 + <tocitem text="Running the Tester" target="caps_jbi_tester_running_tester" />
15.21 + </tocitem>
15.22 + <tocitem text="Java Business Integration (JBI) Basics" target="caps_basics_jbi">
15.23 + <tocitem text="JBI Nodes: Runtime Functionality" target="caps_jbi_runtime_function" />
15.24 + </tocitem>
15.25 + </tocitem>
15.26 +</toc>
16.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
16.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/capshelp.hs Fri Oct 20 12:37:37 2006 +0000
16.3 @@ -0,0 +1,29 @@
16.4 +<?xml version='1.0' encoding='ISO-8859-1'?>
16.5 +<!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN"
16.6 + "http://java.sun.com/products/javahelp/helpset_2_0.dtd">
16.7 +
16.8 +<helpset version="2.0">
16.9 + <title>Composite Application Help</title>
16.10 + <maps>
16.11 + <homeID>caps_intro</homeID>
16.12 + <mapref location="capshelp-map.jhm"/>
16.13 + </maps>
16.14 + <view>
16.15 + <name>TOC</name>
16.16 + <label>Table of Contents</label>
16.17 + <type>javax.help.TOCView</type>
16.18 + <data>capshelp-toc.xml</data>
16.19 + </view>
16.20 + <view>
16.21 + <name>Index</name>
16.22 + <label>Index</label>
16.23 + <type>javax.help.IndexView</type>
16.24 + <data>capshelp-idx.xml</data>
16.25 + </view>
16.26 + <view>
16.27 + <name>Search</name>
16.28 + <label>Search</label>
16.29 + <type>javax.help.SearchView</type>
16.30 + <data engine="com.sun.java.help.search.DefaultSearchEngine">JavaHelpSearch</data>
16.31 + </view>
16.32 +</helpset>
17.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
17.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/credits.html Fri Oct 20 12:37:37 2006 +0000
17.3 @@ -0,0 +1,18 @@
17.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
17.5 +<!--
17.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
17.7 +* Use is subject to license terms.
17.8 +-->
17.9 +<html>
17.10 +<head>
17.11 +<title>Legal Notices</title>
17.12 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
17.13 +</head>
17.14 +<body>
17.15 +<p>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. </p>
17.16 +<p>You can obtain a copy of the License at <tt>http://www.netbeans.org/cddl.html</tt> or <tt>http://www.netbeans.org/cddl.txt</tt>.</p>
17.17 +<p>When distributing Covered Code, include this CDDL Header Notice in each file and include the License file at http://www.netbeans.org/cddl.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]" </p>
17.18 +<p>The Original Software is NetBeans. The Initial Developer of the Original Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.</p>
17.19 +<p><b>Note:</b> Sun is not responsible for the availability of third-party web sites mentioned in this document and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. Sun will not be responsible or liable for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods, or services available on or through any such sites or resources.</p>
17.20 +</body>
17.21 +</html>
18.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
18.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/intro.html Fri Oct 20 12:37:37 2006 +0000
18.3 @@ -0,0 +1,27 @@
18.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
18.5 +<!--
18.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
18.7 +* Use is subject to license terms.
18.8 +-->
18.9 +<html>
18.10 +<head>
18.11 +<title>About Composite Applications</title>
18.12 +<link rel="StyleSheet" href="/org/netbeans/modules/usersguide/ide.css" type="text/css">
18.13 +</head>
18.14 +<body>
18.15 +<h2>About Composite Applications</h2>
18.16 +<p>Using Composite Application projects, one can compose business logic of several project types into
18.17 +a compsite application targeting the Java Business Integration (JBI) server. The project system provides support for the developer to easily:</p>
18.18 +<ul>
18.19 + <li>assemble an application utilizing multiple project types, e.g., BPEL, XSLT, and others;</li>
18.20 + <li>configure external/edge access protocols, e.g., soap, jms, smtp, and others;</li>
18.21 + <li>build JBI deployment packages;</li>
18.22 + <li>deploy the application image to the target JBI server;</li>
18.23 + <li>monitor JBI server components and applications status;</li>
18.24 + <li>define and run test cases;</li>
18.25 +</ul>
18.26 +<hr>
18.27 +<small>Copyright © 2006 Sun Microsystems, Inc. All rights reserved.<br>
18.28 +<a href="credits.html">Legal Notices</a></small>
18.29 +</body>
18.30 +</html>
19.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
19.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/jbinode/caps_jbi_node.html Fri Oct 20 12:37:37 2006 +0000
19.3 @@ -0,0 +1,42 @@
19.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
19.5 +<!--
19.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
19.7 +* Use is subject to license terms.
19.8 +-->
19.9 +<html>
19.10 +<head>
19.11 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
19.12 +<title>JBI Node (Under Runtime/Servers)</title>
19.13 +</head>
19.14 +<body>
19.15 +<h2>JBI Node (Under Runtime/Servers)</h2>
19.16 +<p><small><a href="#seealso">See Also</a></small></p>
19.17 +<p>The JBI node holds all installed or deployed JBI components in one of the following subfolders:</p>
19.18 +<ul>
19.19 + <li><a href="caps_jbi_node_ServiceEngines.html">Service Engines:</a> Perform transformations.<br>
19.20 + You can use the folder's pop-up menu to install a new Service Engine or to refresh the current list.</li>
19.21 + <li><a href="caps_jbi_node_BindingComponents.html">Binding Components:</a> Connect to external systems.
19.22 + <br>
19.23 + You can use the folder's pop-up menu to install a new Binding Component or to refresh the current list.</li>
19.24 + <li><a href="caps_jbi_node_SharedLibraries.html">Shared Libraries:</a>Components that provide common code shared by multiple JBI components
19.25 + deployed on the JBI meta-container. Shared libraries are required by some SEs and BCs to function properly. <br>
19.26 +You can use the folder's pop-up menu to install a new shared library or to refresh the current list. </li>
19.27 + <li><a href="caps_jbi_node_ServiceAssemblies.html">Service Assemblies:</a> Deployable SOA applications.
19.28 + <br>
19.29 + You can use the folder's pop-up menu to deploy a new Service Assembly or to refresh the current list.</li>
19.30 +</ul>
19.31 +<dl>
19.32 +<dt><a name="seealso">See Also</a></dt>
19.33 +<dd><a href="caps_jbi_node_RuntimeFunctionality.html" title="JBI Nodes: Runtime Functionality">JBI Nodes: Runtime Functionality</a></dd>
19.34 +<dd><a href="nbdocs://org.netbeans.modules.bpel.bpelhelp/org/netbeans/modules/bpel/bpelhelp/test_run/about.html" title="Deploying and Performing Test Runs of BPEL Processes">Deploying and Performing Test Runs of BPEL Processes</a></dd>
19.35 +</dl>
19.36 +<hr>
19.37 +<small>
19.38 +<a href="../credits.html">Legal Notices</a></small>
19.39 +<table border="0" cellpadding="150">
19.40 +<tr><td> </td></tr>
19.41 +<tr><td> </td></tr>
19.42 +<tr><td> </td></tr>
19.43 +</table>
19.44 +</body>
19.45 +</html>
20.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
20.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/jbinode/caps_jbi_node_BindingComponents.html Fri Oct 20 12:37:37 2006 +0000
20.3 @@ -0,0 +1,36 @@
20.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
20.5 +<!--
20.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
20.7 +* Use is subject to license terms.
20.8 +-->
20.9 +<html>
20.10 +<head>
20.11 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
20.12 +<title>Binding Components Node (Under Runtime/Server/JBI)</title>
20.13 +</head>
20.14 +<body>
20.15 +<h2>Binding Components Node (Under Runtime/Server/JBI)</h2>
20.16 +<p><small><a href="#seealso">See Also</a></small></p>
20.17 +<p>The Binding Components node is a folder containing all
20.18 + JBI Binding Components that are currently installed to this server. A binding component is the JBI component type that connects to external
20.19 + systems.</p>
20.20 +<p>The pop-up menu of each Binding Component subnode allows you to start,
20.21 + stop, shut down, or uninstall it.
20.22 +</p>
20.23 +<dl>
20.24 +<dt><a name="seealso">See Also</a></dt>
20.25 +<dd><a href="caps_jbi_node.html" title="JBI Node (Under Runtime/Servers)">JBI Node (Under Runtime/Servers)</a></dd>
20.26 +<dd><a href="caps_jbi_node_ServiceAssemblies.html" title="Service Assemblies Node (Under Runtime/Server/JBI)">Service Assemblies Node (Under Runtime/Server/JBI)</a></dd>
20.27 +<dd><a href="caps_jbi_node_ServiceEngines.html" title="Service Engines Node (Under Runtime/Server/JBI)">Service Engines Node (Under Runtime/Server/JBI)</a></dd>
20.28 +<dd><a href="caps_jbi_node_SharedLibraries.html" title="Shared Libraries Node (Under Runtime/Server/JBI)">Shared Libraries Node (Under Runtime/Server/JBI)</a></dd>
20.29 +</dl>
20.30 +<hr>
20.31 +<small>
20.32 +<a href="../credits.html">Legal Notices</a></small>
20.33 +<table border="0" cellpadding="150">
20.34 +<tr><td> </td></tr>
20.35 +<tr><td> </td></tr>
20.36 +<tr><td> </td></tr>
20.37 +</table>
20.38 +</body>
20.39 +</html>
21.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
21.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/jbinode/caps_jbi_node_RuntimeFunctionality.html Fri Oct 20 12:37:37 2006 +0000
21.3 @@ -0,0 +1,51 @@
21.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
21.5 +<!--
21.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
21.7 +* Use is subject to license terms.
21.8 +-->
21.9 +<html>
21.10 +<head>
21.11 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
21.12 +<title>JBI Nodes: Runtime Functionality</title>
21.13 +</head>
21.14 +<body>
21.15 +<h2>JBI Nodes: Runtime Functionality</h2>
21.16 +<p><small><a href="#seealso">See Also</a></small></p>
21.17 +<p>You can perform the following runtime actions on items contained in the subfolders of the JBI node:</p>
21.18 +<ul>
21.19 + <li>By right-clicking a component name under the <a href="caps_jbi_node_ServiceEngines.html" title="Service Engines Node (Under Runtime/Server/JBI)">Service Engines</a> node, you can start, stop, shut down, or uninstall an existing Service Engine. </li>
21.20 + <li>By right-clicking a component name under the <a href="caps_jbi_node_BindingComponents.html" title="Binding Components Node (Under Runtime/Server/JBI)">Binding Components</a> node, you can start, stop, shut down, or uninstall an existing Binding Component. </li>
21.21 + <li>By right-clicking a component name under the <a href="caps_jbi_node_SharedLibraries.html" title="Shared Libraries Node (Under Runtime/Server/JBI)"> Shared Libraries</a> node, you can uninstall an existing shared library. </li>
21.22 + <li>By right-clicking a component name under the <a href="caps_jbi_node_ServiceAssemblies.html">Service Assemblies</a> node, you can start, stop, shut down, or undeploy an existing Service Assembly. </li>
21.23 +</ul>
21.24 +<p>In addition, you can right-click the folder itself to install/deploy a new component or to
21.25 + refresh the current list.
21.26 + Note that components can be installed and deployed by tools other than the JBI node by such means as ant tasks or the administrator console.
21.27 + Therefore, it is good practice to refresh the component list immediately before you use a pop-up menu to take any action. </p>
21.28 +<h3>
21.29 +Starting, Stopping, Shutting Down, and Uninstalling/Undeploying
21.30 +</h3>
21.31 +<ul>
21.32 + <li>Starting or stopping a component causes it to begin or end processing, such as
21.33 + reading/transforming/writing data, or seeking/making/dropping connections. </li>
21.34 + <li>Shutting down a component keeps it available to application server while flagging
21.35 + it as not currently processing. </li>
21.36 + <li>Uninstalling a component, or undeploying a Service Assembly, removes it from
21.37 + the set of components that are available to the application server. </li>
21.38 +</ul>
21.39 +<dl>
21.40 +<dt><a name="seealso">See Also</a></dt>
21.41 +<dd><a href="caps_jbi_node.html" title="JBI Node (Under Runtime/Servers)">JBI Node (Under Runtime/Servers)</a></dd>
21.42 +<dd><a href="caps_jbi_node_ServiceAssemblies.html" title="Service Assemblies Node (Under Runtime/Server/JBI)">Service Assemblies Node (Under Runtime/Server/JBI)</a></dd>
21.43 +<dd><a href="caps_jbi_node_ServiceEngines.html" title="Service Engines Node (Under Runtime/Server/JBI)">Service Engines Node (Under Runtime/Server/JBI)</a></dd>
21.44 +</dl>
21.45 +<hr>
21.46 +<small>
21.47 +<a href="../credits.html">Legal Notices</a></small>
21.48 +<table border="0" cellpadding="150">
21.49 +<tr><td> </td></tr>
21.50 +<tr><td> </td></tr>
21.51 +<tr><td> </td></tr>
21.52 +</table>
21.53 +</body>
21.54 +</html>
22.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
22.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/jbinode/caps_jbi_node_ServiceAssemblies.html Fri Oct 20 12:37:37 2006 +0000
22.3 @@ -0,0 +1,34 @@
22.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
22.5 +<!--
22.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22.7 +* Use is subject to license terms.
22.8 +-->
22.9 +<html>
22.10 +<head>
22.11 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
22.12 +<title>Service Assemblies Node (Under Runtime/Server/JBI)</title>
22.13 +</head>
22.14 +<body>
22.15 +<h2>Service Assemblies Node (Under Runtime/Server/JBI)</h2>
22.16 +<p><small><a href="#seealso">See Also</a></small></p>
22.17 +<p>The Service Assemblies node is a folder containing all
22.18 + Service Assemblies that are currently deployed to this server. </p>
22.19 +<p>A Service Assembly is a single standard document describing the routing, artifacts, and services that make up an SOA application. You can think of a Service Assembly as an SOA "super <tt>.jar</tt> file" that packages together the individual Service Units, modules, and configurations into a single deployable entity. </p>
22.20 +<p>The pop-up menu of each Service Assembly subnode allows you to start, stop, shut down, or undeploy it.</p>
22.21 +<dl>
22.22 +<dt><a name="seealso">See Also</a></dt>
22.23 +<dd><a href="caps_jbi_node.html" title="JBI Node (Under Runtime/Servers)">JBI Node (Under Runtime/Servers)</a></dd>
22.24 +<dd><a href="caps_jbi_node_BindingComponents.html" title="Binding Components Node (Under Runtime/Server/JBI)">Binding Components Node (Under Runtime/Server/JBI)</a></dd>
22.25 +<dd><a href="caps_jbi_node_ServiceEngines.html" title="Service Engines Node (Under Runtime/Server/JBI)">Service Engines Node (Under Runtime/Server/JBI)</a></dd>
22.26 +<dd><a href="caps_jbi_node_SharedLibraries.html" title="Shared Libraries Node (Under Runtime/Server/JBI)">Shared Libraries Node (Under Runtime/Server/JBI)</a></dd>
22.27 +</dl>
22.28 +<hr>
22.29 +<small>
22.30 +<a href="../credits.html">Legal Notices</a></small>
22.31 +<table border="0" cellpadding="150">
22.32 +<tr><td> </td></tr>
22.33 +<tr><td> </td></tr>
22.34 +<tr><td> </td></tr>
22.35 +</table>
22.36 +</body>
22.37 +</html>
22.38 \ No newline at end of file
23.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
23.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/jbinode/caps_jbi_node_ServiceEngines.html Fri Oct 20 12:37:37 2006 +0000
23.3 @@ -0,0 +1,34 @@
23.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
23.5 +<!--
23.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23.7 +* Use is subject to license terms.
23.8 +-->
23.9 +<html>
23.10 +<head>
23.11 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
23.12 +<title>Service Engines Node (Under Runtime/Server/JBI)</title>
23.13 +</head>
23.14 +<body>
23.15 +<h2>Service Engines Node (Under Runtime/Server/JBI)</h2>
23.16 +<p><small><a href="#seealso">See Also</a></small></p>
23.17 +<p>The Service Engines node is a folder containing all
23.18 + JBI Service Engines that are currently installed to this server. A service engine is the JBI component type that performs data transformations.</p>
23.19 +<p>The pop-up menu of each Service Engine subnode allows you to start,
23.20 + stop, shut down, or uninstall it. </p>
23.21 +<dl>
23.22 +<dt><a name="seealso">See Also</a></dt>
23.23 +<dd><a href="caps_jbi_node.html" title="JBI Node (Under Runtime/Servers)">JBI Node (Under Runtime/Servers)</a></dd>
23.24 +<dd><a href="caps_jbi_node_BindingComponents.html" title="Binding Components Node (Under Runtime/Server/JBI)">Binding Components Node (Under Runtime/Server/JBI)</a></dd>
23.25 +<dd><a href="caps_jbi_node_ServiceAssemblies.html" title="Service Assemblies Node (Under Runtime/Server/JBI)">Service Assemblies Node (Under Runtime/Server/JBI)</a></dd>
23.26 +<dd><a href="caps_jbi_node_SharedLibraries.html" title="Shared Libraries Node (Under Runtime/Server/JBI)">Shared Libraries Node (Under Runtime/Server/JBI)</a></dd>
23.27 +</dl>
23.28 +<hr>
23.29 +<small>
23.30 +<a href="../credits.html">Legal Notices</a></small>
23.31 +<table border="0" cellpadding="150">
23.32 +<tr><td> </td></tr>
23.33 +<tr><td> </td></tr>
23.34 +<tr><td> </td></tr>
23.35 +</table>
23.36 +</body>
23.37 +</html>
23.38 \ No newline at end of file
24.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
24.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/jbinode/caps_jbi_node_SharedLibraries.html Fri Oct 20 12:37:37 2006 +0000
24.3 @@ -0,0 +1,36 @@
24.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
24.5 +<!--
24.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24.7 +* Use is subject to license terms.
24.8 +-->
24.9 +<html>
24.10 +<head>
24.11 +<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
24.12 +<title>Shared Libraries Node (Under Runtime/Server/JBI)</title>
24.13 +</head>
24.14 +<body>
24.15 +<h2>Shared Libraries Node (Under Runtime/Server/JBI)</h2>
24.16 +<p><small><a href="#seealso">See Also</a></small></p>
24.17 +<p>The Shared Libraries node is a folder containing all
24.18 + shared libraries that are currently installed to this server.</p>
24.19 +<p>Shared libraries provide common code shared by multiple
24.20 + JBI components deployed on the JBI meta-container.
24.21 + They are required by some service engines and binding components to function properly.</p>
24.22 +<p>The pop-up menu of each Shared Libraries subnode allows you to
24.23 + install or uninstall it. </p>
24.24 +<dl>
24.25 +<dt><a name="seealso">See Also</a></dt>
24.26 +<dd><a href="caps_jbi_node.html" title="JBI Node (Under Runtime/Servers)">JBI Node (Under Runtime/Servers)</a></dd>
24.27 +<dd><a href="caps_jbi_node_ServiceAssemblies.html" title="Service Assemblies Node (Under Runtime/Server/JBI)">Service Assemblies Node (Under Runtime/Server/JBI)</a></dd>
24.28 +<dd><a href="caps_jbi_node_ServiceEngines.html" title="Service Engines Node (Under Runtime/Server/JBI)">Service Engines Node (Under Runtime/Server/JBI)</a></dd>
24.29 +</dl>
24.30 +<hr>
24.31 +<small>
24.32 +<a href="../credits.html">Legal Notices</a></small>
24.33 +<table border="0" cellpadding="150">
24.34 +<tr><td> </td></tr>
24.35 +<tr><td> </td></tr>
24.36 +<tr><td> </td></tr>
24.37 +</table>
24.38 +</body>
24.39 +</html>
25.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
25.2 +++ b/compapp.help/javahelp/org/netbeans/modules/compapp/capshelp/properties/caps_project_props.html Fri Oct 20 12:37:37 2006 +0000
25.3 @@ -0,0 +1,48 @@
25.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
25.5 +<!--
25.6 +* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25.7 +* Use is subject to license terms.
25.8 +-->
25.9 +<html>
25.10 +<head>
25.11 +<title>Java Business Integration (JBI)</title>
25.12 +<link rel="StyleSheet" href="/org/netbeans/modules/usersguide/ide.css" type="text/css">
25.13 +</head>
25.14 +<body>
25.15 +
25.16 +<!-- MAIN CONTENT -->
25.17 +
25.18 +<h2>Composite Application Project Properties Dialog Box</h2>
25.19 +
25.20 +<p>You open the Properties dialog box for a Composite Application project
25.21 +by right-clicking the Composite Application project node and choosing Properties.
25.22 +The tree in the left pane shows that you have access to three pages:</p>
25.23 +
25.24 +<ul>
25.25 + <li>General</li>
25.26 + <li>(Build) > Packaging Project</li>
25.27 + <li>(Run) > Running Project</li>
25.28 +</ul>
25.29 +
25.30 +<p>The General page allows you to view the path of the folder containing
25.31 +the project's files and to supply aliases and descriptions for the project's
25.32 +Service Assembly and Service Unit.</p>
25.33 +
25.34 +<p>The Packaging Project page allows you to:</p>
25.35 +
25.36 +<ul>
25.37 + <li>View or modify the filename of the application <tt>.jar</tt> file to be deployed.</li>
25.38 + <li>View and update the resources (binding components and service engines) that are targeted.</li>
25.39 + <li>View, add, or remove the artifacts (JBI modules) to be deployed in the service assembly.</li>
25.40 +</ul>
25.41 +
25.42 +<p>The Running Project page allows you to view or modify the server that is running the project.
25.43 +(If only one server available, the drop-down list contains only one item.)</p>
25.44 +
25.45 +<!-- END OF MAIN CONTENT -->
25.46 +
25.47 +<hr>
25.48 +<small><a href="../credits.html">Legal Notices</a></small>
25.49 +</body>
25.50 +</html>
25.51 +
26.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
26.2 +++ b/compapp.help/manifest.mf Fri Oct 20 12:37:37 2006 +0000
26.3 @@ -0,0 +1,6 @@
26.4 +Manifest-Version: 1.0
26.5 +OpenIDE-Module: org.netbeans.modules.compapp.capshelp
26.6 +OpenIDE-Module-Layer: org/netbeans/modules/compapp/capshelp/layer.xml
26.7 +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/compapp/capshelp/Bundle.properties
26.8 +OpenIDE-Module-Specification-Version: 1.1
26.9 +
27.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
27.2 +++ b/compapp.help/nbproject/project.properties Fri Oct 20 12:37:37 2006 +0000
27.3 @@ -0,0 +1,21 @@
27.4 +#
27.5 +# The contents of this file are subject to the terms of the Common Development
27.6 +# and Distribution License (the License). You may not use this file except in
27.7 +# compliance with the License.
27.8 +#
27.9 +# You can obtain a copy of the License at http://www.netbeans.org/cddl.html
27.10 +# or http://www.netbeans.org/cddl.txt.
27.11 +
27.12 +# When distributing Covered Code, include this CDDL Header Notice in each file
27.13 +# and include the License file at http://www.netbeans.org/cddl.txt.
27.14 +# If applicable, add the following below the CDDL Header, with the fields
27.15 +# enclosed by brackets [] replaced by your own identifying information:
27.16 +# "Portions Copyrighted [year] [name of copyright owner]"
27.17 +#
27.18 +# The Original Software is NetBeans. The Initial Developer of the Original
27.19 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
27.20 +# Microsystems, Inc. All Rights Reserved.
27.21 +#
27.22 +
27.23 +jhall.jar=${netbeans.dest.dir}/../external/jhall-2.0_03.jar
27.24 +javahelp.base=org/netbeans/modules/compapp/capshelp
28.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
28.2 +++ b/compapp.help/nbproject/project.xml Fri Oct 20 12:37:37 2006 +0000
28.3 @@ -0,0 +1,40 @@
28.4 +<?xml version="1.0" encoding="UTF-8"?>
28.5 +
28.6 +<!--
28.7 +The contents of this file are subject to the terms of the Common Development
28.8 +and Distribution License (the License). You may not use this file except in
28.9 +compliance with the License.
28.10 +
28.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
28.12 +or http://www.netbeans.org/cddl.txt.
28.13 +
28.14 +When distributing Covered Code, include this CDDL Header Notice in each file
28.15 +and include the License file at http://www.netbeans.org/cddl.txt.
28.16 +If applicable, add the following below the CDDL Header, with the fields
28.17 +enclosed by brackets [] replaced by your own identifying information:
28.18 +"Portions Copyrighted [year] [name of copyright owner]"
28.19 +
28.20 + The Original Software is NetBeans. The Initial Developer of the Original
28.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
28.22 + Microsystems, Inc. All Rights Reserved.
28.23 +-->
28.24 +
28.25 +<project xmlns="http://www.netbeans.org/ns/project/1">
28.26 + <type>org.netbeans.modules.apisupport.project</type>
28.27 + <configuration>
28.28 + <data xmlns="http://www.netbeans.org/ns/nb-module-project/2">
28.29 + <code-name-base>org.netbeans.modules.compapp.capshelp</code-name-base>
28.30 + <suite-component/>
28.31 + <module-dependencies>
28.32 + <dependency>
28.33 + <code-name-base>org.netbeans.modules.javahelp</code-name-base>
28.34 + <run-dependency>
28.35 + <release-version>1</release-version>
28.36 + <specification-version>1.0</specification-version>
28.37 + </run-dependency>
28.38 + </dependency>
28.39 + </module-dependencies>
28.40 + <public-packages/>
28.41 + </data>
28.42 + </configuration>
28.43 +</project>
29.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
29.2 +++ b/compapp.help/src/org/netbeans/modules/compapp/capshelp/Bundle.properties Fri Oct 20 12:37:37 2006 +0000
29.3 @@ -0,0 +1,23 @@
29.4 +#
29.5 +# The contents of this file are subject to the terms of the Common Development
29.6 +# and Distribution License (the License). You may not use this file except in
29.7 +# compliance with the License.
29.8 +#
29.9 +# You can obtain a copy of the License at http://www.netbeans.org/cddl.html
29.10 +# or http://www.netbeans.org/cddl.txt.
29.11 +#
29.12 +# When distributing Covered Code, include this CDDL Header Notice in each file
29.13 +# and include the License file at http://www.netbeans.org/cddl.txt.
29.14 +# If applicable, add the following below the CDDL Header, with the fields
29.15 +# enclosed by brackets [] replaced by your own identifying information:
29.16 +# "Portions Copyrighted [year] [name of copyright owner]"
29.17 +#
29.18 +# The Original Software is NetBeans. The Initial Developer of the Original
29.19 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
29.20 +# Microsystems, Inc. All Rights Reserved.
29.21 +
29.22 +# manifest
29.23 +OpenIDE-Module-Name=Composite Application Help Topics
29.24 +OpenIDE-Module-Display-Category=Service-Oriented Architecture
29.25 +OpenIDE-Module-Short-Description=Composite Application Help Topics.
29.26 +OpenIDE-Module-Long-Description=Composite Application Help Topics.
30.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
30.2 +++ b/compapp.help/src/org/netbeans/modules/compapp/capshelp/helpset.xml Fri Oct 20 12:37:37 2006 +0000
30.3 @@ -0,0 +1,25 @@
30.4 +<?xml version="1.0" encoding="UTF-8"?>
30.5 +
30.6 +<!--
30.7 +The contents of this file are subject to the terms of the Common Development
30.8 +and Distribution License (the License). You may not use this file except in
30.9 +compliance with the License.
30.10 +
30.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
30.12 +or http://www.netbeans.org/cddl.txt.
30.13 +
30.14 +When distributing Covered Code, include this CDDL Header Notice in each file
30.15 +and include the License file at http://www.netbeans.org/cddl.txt.
30.16 +If applicable, add the following below the CDDL Header, with the fields
30.17 +enclosed by brackets [] replaced by your own identifying information:
30.18 +"Portions Copyrighted [year] [name of copyright owner]"
30.19 +
30.20 + The Original Software is NetBeans. The Initial Developer of the Original
30.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
30.22 + Microsystems, Inc. All Rights Reserved.
30.23 +-->
30.24 +
30.25 +<!DOCTYPE helpsetref PUBLIC
30.26 + "-//NetBeans//DTD JavaHelp Help Set Reference 1.0//EN"
30.27 + "http://www.netbeans.org/dtds/helpsetref-1_0.dtd">
30.28 + <helpsetref url="nbdocs:/org/netbeans/modules/compapp/capshelp/capshelp.hs"/>
30.29 \ No newline at end of file
31.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
31.2 +++ b/compapp.help/src/org/netbeans/modules/compapp/capshelp/layer.xml Fri Oct 20 12:37:37 2006 +0000
31.3 @@ -0,0 +1,31 @@
31.4 +<?xml version="1.0" encoding="UTF-8"?>
31.5 +
31.6 +<!--
31.7 +The contents of this file are subject to the terms of the Common Development
31.8 +and Distribution License (the License). You may not use this file except in
31.9 +compliance with the License.
31.10 +
31.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
31.12 +or http://www.netbeans.org/cddl.txt.
31.13 +
31.14 +When distributing Covered Code, include this CDDL Header Notice in each file
31.15 +and include the License file at http://www.netbeans.org/cddl.txt.
31.16 +If applicable, add the following below the CDDL Header, with the fields
31.17 +enclosed by brackets [] replaced by your own identifying information:
31.18 +"Portions Copyrighted [year] [name of copyright owner]"
31.19 +
31.20 + The Original Software is NetBeans. The Initial Developer of the Original
31.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
31.22 + Microsystems, Inc. All Rights Reserved.
31.23 +-->
31.24 +
31.25 +<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
31.26 +<filesystem>
31.27 + <folder name="Services">
31.28 + <folder name="JavaHelp">
31.29 + <file name="org-netbeans-modules-compapp-capshelp-helpset.xml" url="helpset.xml"/>
31.30 + <attr name="org-netbeans-modules-usersguide-below-regular.txt/org-netbeans-modules-compapp-capshelp-helpset.xml" boolvalue="true"/>
31.31 + </folder>
31.32 + </folder>
31.33 +</filesystem>
31.34 +
32.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
32.2 +++ b/compapp.manager.jbi/build.xml Fri Oct 20 12:37:37 2006 +0000
32.3 @@ -0,0 +1,28 @@
32.4 +<?xml version="1.0" encoding="UTF-8"?>
32.5 +
32.6 +<!--
32.7 +The contents of this file are subject to the terms of the Common Development
32.8 +and Distribution License (the License). You may not use this file except in
32.9 +compliance with the License.
32.10 +
32.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
32.12 +or http://www.netbeans.org/cddl.txt.
32.13 +
32.14 +When distributing Covered Code, include this CDDL Header Notice in each file
32.15 +and include the License file at http://www.netbeans.org/cddl.txt.
32.16 +If applicable, add the following below the CDDL Header, with the fields
32.17 +enclosed by brackets [] replaced by your own identifying information:
32.18 +"Portions Copyrighted [year] [name of copyright owner]"
32.19 +
32.20 + The Original Software is NetBeans. The Initial Developer of the Original
32.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
32.22 + Microsystems, Inc. All Rights Reserved.
32.23 +-->
32.24 +
32.25 +<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
32.26 +<!-- for some information on what you could do (e.g. targets to override). -->
32.27 +<!-- If you delete this file and reopen the project it will be recreated. -->
32.28 +<project name="org.netbeans.modules.sun.manager.jbi" default="netbeans" basedir=".">
32.29 + <description>Builds, tests, and runs the project org.netbeans.modules.sun.manager.jbi.</description>
32.30 + <import file="nbproject/build-impl.xml"/>
32.31 +</project>
33.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
33.2 +++ b/compapp.manager.jbi/manifest.mf Fri Oct 20 12:37:37 2006 +0000
33.3 @@ -0,0 +1,6 @@
33.4 +Manifest-Version: 1.0
33.5 +OpenIDE-Module: org.netbeans.modules.sun.manager.jbi
33.6 +OpenIDE-Module-Layer: org/netbeans/modules/sun/manager/jbi/layer.xml
33.7 +OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/sun/manager/jbi/Bundle.properties
33.8 +OpenIDE-Module-Specification-Version: 1.1
33.9 +
34.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
34.2 +++ b/compapp.manager.jbi/nbproject/project.properties Fri Oct 20 12:37:37 2006 +0000
34.3 @@ -0,0 +1,22 @@
34.4 +
34.5 +#
34.6 +# The contents of this file are subject to the terms of the Common Development
34.7 +# and Distribution License (the License). You may not use this file except in
34.8 +# compliance with the License.
34.9 +#
34.10 +# You can obtain a copy of the License at http://www.netbeans.org/cddl.html
34.11 +# or http://www.netbeans.org/cddl.txt.
34.12 +
34.13 +# When distributing Covered Code, include this CDDL Header Notice in each file
34.14 +# and include the License file at http://www.netbeans.org/cddl.txt.
34.15 +# If applicable, add the following below the CDDL Header, with the fields
34.16 +# enclosed by brackets [] replaced by your own identifying information:
34.17 +# "Portions Copyrighted [year] [name of copyright owner]"
34.18 +#
34.19 +# The Original Software is NetBeans. The Initial Developer of the Original
34.20 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
34.21 +# Microsystems, Inc. All Rights Reserved.
34.22 +#
34.23 +
34.24 +cp.extra=../../../nbbuild/netbeans/enterprise3/modules/ext/appsrvbridge.jar
34.25 +javac.source=1.5
35.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
35.2 +++ b/compapp.manager.jbi/nbproject/project.xml Fri Oct 20 12:37:37 2006 +0000
35.3 @@ -0,0 +1,105 @@
35.4 +<?xml version="1.0" encoding="UTF-8"?>
35.5 +<!--
35.6 +The contents of this file are subject to the terms of the Common Development
35.7 +and Distribution License (the License). You may not use this file except in
35.8 +compliance with the License.
35.9 +
35.10 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
35.11 +or http://www.netbeans.org/cddl.txt.
35.12 +
35.13 +When distributing Covered Code, include this CDDL Header Notice in each file
35.14 +and include the License file at http://www.netbeans.org/cddl.txt.
35.15 +If applicable, add the following below the CDDL Header, with the fields
35.16 +enclosed by brackets [] replaced by your own identifying information:
35.17 +"Portions Copyrighted [year] [name of copyright owner]"
35.18 +
35.19 + The Original Software is NetBeans. The Initial Developer of the Original
35.20 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
35.21 + Microsystems, Inc. All Rights Reserved.
35.22 +-->
35.23 +<project xmlns="http://www.netbeans.org/ns/project/1">
35.24 + <type>org.netbeans.modules.apisupport.project</type>
35.25 + <configuration>
35.26 + <data xmlns="http://www.netbeans.org/ns/nb-module-project/2">
35.27 + <code-name-base>org.netbeans.modules.sun.manager.jbi</code-name-base>
35.28 + <suite-component/>
35.29 + <module-dependencies>
35.30 + <dependency>
35.31 + <code-name-base>org.netbeans.api.progress</code-name-base>
35.32 + <build-prerequisite/>
35.33 + <compile-dependency/>
35.34 + <run-dependency>
35.35 + <release-version>1</release-version>
35.36 + <specification-version>1.5.1</specification-version>
35.37 + </run-dependency>
35.38 + </dependency>
35.39 + <dependency>
35.40 + <code-name-base>org.netbeans.modules.j2eeapis</code-name-base>
35.41 + <build-prerequisite/>
35.42 + <compile-dependency/>
35.43 + <run-dependency>
35.44 + <release-version>1</release-version>
35.45 + <specification-version>1.7</specification-version>
35.46 + </run-dependency>
35.47 + </dependency>
35.48 + <dependency>
35.49 + <code-name-base>org.openide.actions</code-name-base>
35.50 + <build-prerequisite/>
35.51 + <compile-dependency/>
35.52 + <run-dependency>
35.53 + <specification-version>6.5.1</specification-version>
35.54 + </run-dependency>
35.55 + </dependency>
35.56 + <dependency>
35.57 + <code-name-base>org.openide.dialogs</code-name-base>
35.58 + <build-prerequisite/>
35.59 + <compile-dependency/>
35.60 + <run-dependency>
35.61 + <specification-version>6.5.1</specification-version>
35.62 + </run-dependency>
35.63 + </dependency>
35.64 + <dependency>
35.65 + <code-name-base>org.openide.explorer</code-name-base>
35.66 + <build-prerequisite/>
35.67 + <compile-dependency/>
35.68 + <run-dependency>
35.69 + <specification-version>6.5.1</specification-version>
35.70 + </run-dependency>
35.71 + </dependency>
35.72 + <dependency>
35.73 + <code-name-base>org.openide.filesystems</code-name-base>
35.74 + <build-prerequisite/>
35.75 + <compile-dependency/>
35.76 + <run-dependency>
35.77 + <specification-version>6.4.21</specification-version>
35.78 + </run-dependency>
35.79 + </dependency>
35.80 + <dependency>
35.81 + <code-name-base>org.openide.io</code-name-base>
35.82 + <build-prerequisite/>
35.83 + <compile-dependency/>
35.84 + <run-dependency>
35.85 + <specification-version>1.9.1</specification-version>
35.86 + </run-dependency>
35.87 + </dependency>
35.88 + <dependency>
35.89 + <code-name-base>org.openide.nodes</code-name-base>
35.90 + <build-prerequisite/>
35.91 + <compile-dependency/>
35.92 + <run-dependency>
35.93 + <specification-version>6.7.1</specification-version>
35.94 + </run-dependency>
35.95 + </dependency>
35.96 + <dependency>
35.97 + <code-name-base>org.openide.util</code-name-base>
35.98 + <build-prerequisite/>
35.99 + <compile-dependency/>
35.100 + <run-dependency>
35.101 + <specification-version>6.8.1</specification-version>
35.102 + </run-dependency>
35.103 + </dependency>
35.104 + </module-dependencies>
35.105 + <public-packages/>
35.106 + </data>
35.107 + </configuration>
35.108 +</project>
36.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
36.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/Bundle.properties Fri Oct 20 12:37:37 2006 +0000
36.3 @@ -0,0 +1,23 @@
36.4 +#
36.5 +# The contents of this file are subject to the terms of the Common Development
36.6 +# and Distribution License (the License). You may not use this file except in
36.7 +# compliance with the License.
36.8 +#
36.9 +# You can obtain a copy of the License at http://www.netbeans.org/cddl.html
36.10 +# or http://www.netbeans.org/cddl.txt.
36.11 +#
36.12 +# When distributing Covered Code, include this CDDL Header Notice in each file
36.13 +# and include the License file at http://www.netbeans.org/cddl.txt.
36.14 +# If applicable, add the following below the CDDL Header, with the fields
36.15 +# enclosed by brackets [] replaced by your own identifying information:
36.16 +# "Portions Copyrighted [year] [name of copyright owner]"
36.17 +#
36.18 +# The Original Software is NetBeans. The Initial Developer of the Original
36.19 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
36.20 +# Microsystems, Inc. All Rights Reserved.
36.21 +
36.22 +# manifest
36.23 +OpenIDE-Module-Name=Composite Application JBI Manager
36.24 +OpenIDE-Module-Display-Category=Service-Oriented Architecture
36.25 +OpenIDE-Module-Short-Description=Composite Application JBI Manager.
36.26 +OpenIDE-Module-Long-Description=Composite Application JBI Manager.
37.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
37.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/GenericConstants.java Fri Oct 20 12:37:37 2006 +0000
37.3 @@ -0,0 +1,259 @@
37.4 +/*
37.5 + * The contents of this file are subject to the terms of the Common Development
37.6 + * and Distribution License (the License). You may not use this file except in
37.7 + * compliance with the License.
37.8 + *
37.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
37.10 + * or http://www.netbeans.org/cddl.txt.
37.11 +
37.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
37.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
37.14 + * If applicable, add the following below the CDDL Header, with the fields
37.15 + * enclosed by brackets [] replaced by your own identifying information:
37.16 + * "Portions Copyrighted [year] [name of copyright owner]"
37.17 + *
37.18 + * The Original Software is NetBeans. The Initial Developer of the Original
37.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
37.20 + * Microsystems, Inc. All Rights Reserved.
37.21 + */
37.22 +
37.23 +package org.netbeans.modules.sun.manager.jbi;
37.24 +
37.25 +/**
37.26 + *
37.27 + * @author Graj
37.28 + */
37.29 +public interface GenericConstants {
37.30 +
37.31 + public static final String PORT = "port"; // NOI18N
37.32 + public static final String HOSTNAME = "hostName"; // NOI18N
37.33 + public static final String DOMAINNAME = "domainName"; // NOI18N
37.34 + public static final String HTTP_ADMINISTRATION_PORT = "httpAdministrationPort"; // NOI18N
37.35 + public static final String IIOP_PORT = "iiopPort"; // NOI18N
37.36 + public static final String JRMP_PORT = "jrmpPort"; // NOI18N
37.37 + public static final String HTTP_ENDPOINT_PORT = "httpEndpointPort"; // NOI18N
37.38 + public static final String USER_NAME = "userName"; // NOI18N
37.39 + public static final String PASSWORD = "password"; // NOI18N
37.40 + public static final String MULTICAST_GROUP_ADDRESS = "multicastGroupAddress"; // NOI18N
37.41 + public static final String MULTICAST_GROUP_PORT = "multicastGroupPort"; // NOI18N
37.42 + public static final String MULTICAST_TIME_TO_LIVE = "multicastTimeToLive"; // NOI18N
37.43 + public static final String MULTICAST_MESSAGE_SEND_INTERVAL = "multicastMessageSendInterval"; // NOI18N
37.44 + public static final String UPDATER_REFRESH_RATE = "updaterRefreshRate"; // seconds // NOI18N
37.45 +
37.46 + public static final String DEFAULT_HOST_NAME = "127.0.0.1"; // NOI18N
37.47 + public static final String DEFAULT_DOMAIN_NAME = "domain1"; // NOI18N
37.48 + public static final String DEFAULT_ADMIN_PORT = "4848"; // NOI18N
37.49 + public static final String DEFAULT_HTTP_USER_PORT = "8080"; // NOI18N
37.50 + public static final String DEFAULT_IIOP_ADMIN_PORT = "3700"; // NOI18N
37.51 + public static final String DEFAULT_JRMP_ADMIN_PORT = "8686"; // NOI18N
37.52 + public static final String DEFAULT_USER_NAME = "admin"; // NOI18N
37.53 + public static final String DEFAULT_CREDENTIALS = "adminadmin"; // NOI18N
37.54 + public static final String DEFAULT_MULTICAST_GROUP_ADDRESS = "225.1.2.3"; // NOI18N
37.55 + public static final String DEFAULT_MULTICAST_GROUP_PORT = "5000"; // NOI18N
37.56 + public static final String DEFAULT_MULTICAST_TIME_TO_LIVE = "10"; // NOI18N
37.57 + public static final String DEFAULT_MULTICAST_MESSAGE_SEND_INTERVAL = "60"; // seconds // NOI18N
37.58 + public static final String DEFAULT_UPDATER_REFRESH_RATE = "8"; // seconds // NOI18N
37.59 +
37.60 + // None
37.61 + public static final int INVALID_DIRECTION_KEY = 10;
37.62 + // backward
37.63 + public static final int PROVIDER_TO_CONSUMER_DIRECTION_KEY = -1;
37.64 + // forward and backward round-trip
37.65 + public static final int CONSUMER_TO_PROVIDER_AND_BACK_DIRECTION_KEY = 0;
37.66 + // forward
37.67 + public static final int CONSUMER_TO_PROVIDER_DIRECTION_KEY = 1;
37.68 +
37.69 + public static final String CONSUMER_SUFFIX = "Consumer"; // NOI18N
37.70 +
37.71 +
37.72 + public static final String PORTMAPS_KEY = "portmaps"; // NOI18N
37.73 + public static final String PORTMAP_KEY = "portmap"; // NOI18N
37.74 + public static final String DIRECTION_KEY = "direction"; // NOI18N
37.75 + public static final String INBOUND_KEY = "inbound"; // NOI18N
37.76 + public static final String OUTBOUND_KEY = "outbound"; // NOI18N
37.77 + public static final String ENDPOINT_KEY = "endPoint"; // NOI18N
37.78 + public static final String SERVICE_KEY = "service"; // NOI18N
37.79 +
37.80 + public static final String COLON_DELIMITER = "\\:"; // NOI18N
37.81 + public static final String DOLLAR_DELIMITER = "\\$"; // NOI18N
37.82 + public static final String VERTICAL_LINE_DELIMITER = "\\|"; // NOI18N
37.83 + public static final String TILDE_DELIMITER = "\\~"; // NOI18N
37.84 +
37.85 + public static final String ENDPOINT_SELECTION_SESSION_KEY = "EndpointsSelected"; // NOI18N
37.86 + public static final String ENDPOINT_MANAGER_SESSION_KEY = "EndpointManager"; // NOI18N
37.87 + public static final String CONNECTION_METADATA_HELPER_SESSION_KEY = "ConnectionMetadataHelper"; // NOI18N
37.88 +
37.89 +// public static final String ASPECT_PACKAGER_METADATA_SESSION_KEY = "AspectPackagerMetadata";
37.90 +// public static final String ASPECT_CONFIGURATION_PROPERTIES_SESSION_KEY = "AspectConfigurationProperties";
37.91 +
37.92 + public static final String GOVERNANCE_CONFIGURATION_SESSION_KEY = "GovernanceConfiguration"; // NOI18N
37.93 + public static final String GOVERNANCE_CURRENT_SERVICE_ASSEMBLY_SESSION_KEY = "GovernanceCurrentServiceAssembly"; // NOI18N
37.94 + public static final String GOVERNANCE_CURRENT_SERVICE_UNIT_LIST_SESSION_KEY = "GovernanceCurrentServiceUnitList"; // NOI18N
37.95 +
37.96 +
37.97 +
37.98 + public static final String CONNECTION_PROPERTIES_KEY = "connection.properties"; // NOI18N
37.99 + public static final String SERVER_INFORMATION_KEY = "SERVER_INFORMATION"; // NOI18N
37.100 +
37.101 + public static final String SERVICE_UNIT_NAME_PARAMETER_KEY = "serviceUnitName"; // NOI18N
37.102 +
37.103 + public static final String NAME_PARAMETER_KEY = "name"; // NOI18N
37.104 + public static final String OPERATION_PARAMETER_KEY = "operation"; // NOI18N
37.105 + public static final String INPUT_PARAMETER_KEY = "input"; // NOI18N
37.106 + public static final String TYPE_PARAMETER_KEY = "type"; // NOI18N
37.107 + public static final String COMPONENT_NAME_KEY = "componentName"; // NOI18N
37.108 + public static final String SHOW_PARAMETER_KEY = "show"; // NOI18N
37.109 + public static final String KEY_PARAMETER_KEY = "key"; // NOI18N
37.110 + public static final String CLEAN_PARAMETER_KEY = "clean"; // NOI18N
37.111 + public static final String FILE_NAME_PARAMETER_KEY = "fileName"; // NOI18N
37.112 + public static final String ACTION_NAME_PARAMETER_KEY = "actionName"; // NOI18N
37.113 + public static final String REMOVE_PARAMETER_KEY = "remove"; // NOI18N
37.114 + public static final String CONFIGURE_PARAMETER_KEY = "configure"; // NOI18N
37.115 +
37.116 + public static final String TYPE_PARAMETER_KEY_VALUE = "ServiceEngine"; // NOI18N
37.117 + public static final String SHOW_CONFIG_PROPERTIES_PARAMETER_KEY_VALUE = "ConfigProperties"; // NOI18N
37.118 + public static final String SHOW_PORTMAP_URL_PARAMETER_KEY_VALUE = "PortMapURL"; // NOI18N
37.119 +
37.120 + public static final String PROVISIONING_ID = "Provider"; // NOI18N
37.121 + public static final String CONSUMING_ID = "Consumer"; // NOI18N
37.122 +
37.123 + public static final String PROVISIONING_SERVICE_NAME = "com.sun.ProvisioningService"; // NOI18N
37.124 + public static final String PROVISIONING_SERVICE_UNIT_SUFFIX = "-ProvisioningServiceUnit"; // NOI18N
37.125 +
37.126 + /** Deployment Type */
37.127 + public static final String DEPLOYMENT_TYPE = "service-assembly"; // NOI18N
37.128 + /** unknown type */
37.129 + public static final String UNKNOWN_TYPE = "unknown"; // NOI18N
37.130 + /** Binding type */
37.131 + public static final String BINDING_TYPE = "binding-component"; // NOI18N
37.132 + /** Engine Type */
37.133 + public static final String ENGINE_TYPE = "service-engine"; // NOI18N
37.134 + /** Namespace Type */
37.135 + public static final String NAMESPACE_TYPE = "shared-library"; // NOI18N
37.136 +
37.137 + /** state Loaded status. */
37.138 + public static final String UNKNOWN_STATE = "Unknown"; // NOI18N
37.139 + /** Installed status */
37.140 + public static final String SHUTDOWN_STATE = "Shutdown"; // NOI18N
37.141 + /** Stopped status */
37.142 + public static final String STOPPED_STATE = "Stopped"; // NOI18N
37.143 + /** Started status */
37.144 + public static final String STARTED_STATE = "Started"; // NOI18N
37.145 +
37.146 +
37.147 +
37.148 +
37.149 + public static final String SOAP_ENCODING_SCHEMA_URL = "http://schemas.xmlsoap.org/soap/encoding/"; // NOI18N
37.150 + public static final String WSDL_SOAP_SCHEMA_URL = "http://schemas.xmlsoap.org/wsdl/soap/"; // NOI18N
37.151 + public static final String WSDL_MODEL_SESSION_ATTRIBUTE_KEY = "WSDL_MODEL_SESSION_ATTRIBUTE"; // NOI18N
37.152 + public static final String WSDL_MODEL_DOCUMENT_SESSION_ATTRIBUTE_KEY = "WSDL_MODEL_DOCUMENT_SESSION_ATTRIBUTE"; // NOI18N
37.153 + public static final String RESULT_SESSION_ATTRIBUTE_KEY = "RESULT"; // NOI18N
37.154 + public static final String SOAP_TRANSPORT_KEY = "http://schemas.xmlsoap.org/soap/http"; // NOI18N
37.155 + public static final String HTTP_URL_PREFIX_KEY = "http://"; // NOI18N
37.156 + public static final String FILE_URL_REFIX_KEY = "file:///"; // NOI18N
37.157 + public static final String WSDL_VERBOSE_KEY = "javax.wsdl.verbose"; // NOI18N
37.158 + public static final String WSDL_IMPORT_DOCUMENTS_KEY = "javax.wsdl.importDocuments"; // NOI18N
37.159 + public static final String WSDL_SCHEMA_URL = "http://schemas.xmlsoap.org/wsdl/"; // NOI18N
37.160 +
37.161 +
37.162 + public static final String LIST_BINDING_COMPONENTS_OPERATION_NAME = "listBindingComponents"; // NOI18N
37.163 + public static final String LIST_SERVICE_ENGINES_OPERATION_NAME = "listServiceEngines"; // NOI18N
37.164 + public static final String LIST_SHARED_LIBRARIES_OPERATION_NAME = "listSharedLibraries"; // NOI18N
37.165 + public static final String LIST_SERVICE_ASSEMBLIES_OPERATION_NAME = "listServiceAssemblies"; // NOI18N
37.166 + public static final String LIST_SHARED_LIBRARY_DEPENDENTS_OPERATION_NAME = "listSharedLibraryDependents"; // NOI18N
37.167 +
37.168 + public static final String DEPLOY_SERVICE_ASSEMBLY_OPERATION_NAME = "deployServiceAssembly"; // NOI18N
37.169 + public static final String INSTALL_COMPONENT_OPERATION_NAME = "installComponent"; // NOI18N
37.170 + public static final String INSTALL_SHARED_LIBRARY_OPERATION_NAME = "installSharedLibrary"; // NOI18N
37.171 + public static final String SHUTDOWN_COMPONENT_OPERATION_NAME = "shutdownComponent"; // NOI18N
37.172 + public static final String START_COMPONENT_OPERATION_NAME = "startComponent"; // NOI18N
37.173 + public static final String STOP_COMPONENT_OPERATION_NAME = "stopComponent"; // NOI18N
37.174 +
37.175 + public static final String START_SERVICE_ASSEMBLY_OPERATION_NAME = "startServiceAssembly"; // NOI18N
37.176 + public static final String STOP_SERVICE_ASSEMBLY_OPERATION_NAME = "stopServiceAssembly"; // NOI18N
37.177 + public static final String SHUTDOWN_SERVICE_ASSEMBLY_OPERATION_NAME = "shutdownServiceAssembly"; // NOI18N
37.178 +
37.179 + public static final String UNDEPLOY_SERVICE_ASSEMBLY_OPERATION_NAME = "undeployServiceAssembly"; // NOI18N
37.180 + public static final String UNINSTALL_COMPONENT_OPERATION_NAME = "uninstallComponent"; // NOI18N
37.181 + public static final String UNINSTALL_SHARED_LIBRARY_OPERATION_NAME = "uninstallSharedLibrary"; // NOI18N
37.182 +
37.183 + public static final String DEPLOY_FOLDER_NAME = "deploy"; // NOI18N
37.184 + public static final String BINDING_COMPONENTS_FOLDER_NAME = "bindingComponents"; // NOI18N
37.185 + public static final String SERVICE_ENGINES_FOLDER_NAME = "serviceEngines"; // NOI18N
37.186 + public static final String SHARED_LIBRARIES_FOLDER_NAME = "sharedLibraries"; // NOI18N
37.187 + public static final String SERVICE_ASSEMBLIES_FOLDER_NAME = "serviceAssemblies"; // NOI18N
37.188 +
37.189 + public static final String SUN_JBI_DOMAIN_NAME = "com.sun.jbi"; // NOI18N
37.190 + public static final String STC_EBI_DOMAIN_NAME = "com.sun.ebi"; // NOI18N
37.191 +
37.192 + public static final String EM_DOMAIN_NOTIFICATION_HANDLER = "com.sun.eManager:name=DomainNotificationHandler,ServiceType=eManagerAdministration"; // NOI18N
37.193 +
37.194 + // MBean Open Type class names
37.195 + public static final String OPEN_TYPE_CLASS_VOID = "java.lang.Void"; // NOI18N
37.196 + public static final String OPEN_TYPE_CLASS_BOOLEAN = "java.lang.Boolean"; // NOI18N
37.197 + public static final String OPEN_TYPE_CLASS_CHARACTER = "java.lang.Character"; // NOI18N
37.198 + public static final String OPEN_TYPE_CLASS_BYTE = "java.lang.Byte"; // NOI18N
37.199 + public static final String OPEN_TYPE_CLASS_SHORT = "java.lang.Short"; // NOI18N
37.200 + public static final String OPEN_TYPE_CLASS_INTEGER = "java.lang.Integer"; // NOI18N
37.201 + public static final String OPEN_TYPE_CLASS_LONG = "java.lang.Long"; // NOI18N
37.202 + public static final String OPEN_TYPE_CLASS_FLOAT = "java.lang.Float"; // NOI18N
37.203 + public static final String OPEN_TYPE_CLASS_DOUBLE = "java.lang.Double"; // NOI18N
37.204 + public static final String OPEN_TYPE_CLASS_STRING = "java.lang.String"; // NOI18N
37.205 + public static final String OPEN_TYPE_CLASS_BIGDECIMAL = "java.math.BigDecimal"; // NOI18N
37.206 + public static final String OPEN_TYPE_CLASS_BIGINTEGER = "java.math.BigInteger"; // NOI18N
37.207 + public static final String OPEN_TYPE_CLASS_DATE = "java.util.Date"; // NOI18N
37.208 + public static final String OPEN_TYPE_CLASS_OBJECTNAME = "javax.management.ObjectName"; // NOI18N
37.209 +
37.210 + // MBean Server Object Name
37.211 + public static final String MBEAN_SERVER_OBJECT_NAME = "JMImplementation:type=MBeanServerDelegate"; // NOI18N
37.212 +
37.213 + /////////////////////////////////////
37.214 + // Local JVM Management Object Names
37.215 + /////////////////////////////////////
37.216 + // Local JVM Management java.lang.management.ManagementFactory MXBeans Object Names
37.217 + public static final String CLASS_LOADING_MXBEAN_NAME = "java.lang:type=ClassLoading"; // NOI18N
37.218 + public static final String COMPILATION_MXBEAN_NAME = "java.lang:type=Compilation"; // NOI18N
37.219 + public static final String GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE = "java.lang:type=GarbageCollector"; // NOI18N
37.220 + public static final String MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE = "java.lang:type=MemoryManager"; // NOI18N
37.221 + public static final String MEMORY_MXBEAN_NAME = "java.lang:type=Memory"; // NOI18N
37.222 + public static final String MEMORY_POOL_MXBEAN_DOMAIN_TYPE = "java.lang:type=MemoryPool"; // NOI18N
37.223 + public static final String OPERATING_SYSTEM_MXBEAN_NAME = "java.lang:type=OperatingSystem"; // NOI18N
37.224 + public static final String RUNTIME_MXBEAN_NAME = "java.lang:type=Runtime"; // NOI18N
37.225 + public static final String THREAD_MXBEAN_NAME = "java.lang:type=Threading"; // NOI18N
37.226 +
37.227 + // Local JVM Management java.lang.management.MemoryNotificationInfo MXBeans Object Names
37.228 + public static final String MEMORY_COLLECTION_THRESHOLD_EXCEEDED = "java.management.memory.collection.threshold.exceeded"; // NOI18N
37.229 + public static final String MEMORY_THRESHOLD_EXCEEDED = "java.management.memory.threshold.exceeded"; // NOI18N
37.230 +
37.231 + /////////////////////////////////////
37.232 + // JBI Framework MBeans Object Names
37.233 + /////////////////////////////////////
37.234 + // Services
37.235 + public static final String JBI_ADMINISTRATION_SERVICE_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=AdministrationService,ServiceName=AdminService"; // NOI18N
37.236 + public static final String JBI_CONFIGURATION_SERVICE_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=ConfigurationService,ServiceName=ConfigurationService"; // NOI18N
37.237 + public static final String JBI_DEPLOYMENT_SERVICE_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=DeploymentService,ServiceName=DeploymentService"; // NOI18N
37.238 + public static final String JBI_INSTALLATION_SERVICE_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=InstallationService,ServiceName=InstallationService"; // NOI18N
37.239 + public static final String JBI_MESSAGE_SERVICE_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=MessageService,ServiceName=MessageService"; // NOI18N
37.240 + public static final String JBI_LOGGING_SERVICE_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=LoggingService,ServiceName=LoggingService"; // NOI18N
37.241 +
37.242 + public static final String JBI_FRAMEWORK_STATISTICS_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=Statistics,ServiceName=Framework"; // NOI18N
37.243 +
37.244 + // Heartbeat
37.245 + public static final String JBI_HEART_BEAT_ADMIN_SERVICE_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=HeartBeat,ServiceName=AdminService"; // NOI18N
37.246 +
37.247 + // Configuration
37.248 + public static final String JBI_ADMINISTRATION_SERVICE_CONFIGURATION_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=Configuration,ServiceName=AdminService"; // NOI18N
37.249 + public static final String JBI_CONFIGURATION_SERVICE_SYSTEM_CONFIG_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=Configuration,ServiceName=ConfigurationService"; // NOI18N
37.250 + public static final String JBI_DEPLOYMENT_SERVICE_SYSTEM_CONFIG_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=Configuration,ServiceName=DeploymentService"; // NOI18N
37.251 + public static final String JBI_INSTALLATION_SERVICE_SYSTEM_CONFIG_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=Configuration,ServiceName=InstallationService"; // NOI18N
37.252 + public static final String JBI_LOGGING_SERVICE_SYSTEM_CONFIG_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=Configuration,ServiceName=LoggingService"; // NOI18N
37.253 + public static final String JBI_MESSAGE_SERVICE_SYSTEM_CONFIG_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=Configuration,ServiceName=MessageService"; // NOI18N
37.254 +
37.255 + // Lifecycle
37.256 + public static final String JBI_ADMINISTRATION_SERVICE_LIFECYCLE_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=Lifecycle,ServiceName=AdminService"; // NOI18N
37.257 + public static final String JBI_CONFIGURATION_SERVICE_LIFECYCLE_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=Lifecycle,ServiceName=ConfigurationService"; // NOI18N
37.258 + public static final String JBI_DEPLOYMENT_SERVICE_LIFECYCLE_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=Lifecycle,ServiceName=DeploymentService"; // NOI18N
37.259 + public static final String JBI_INSTALLATION_SERVICE_LIFECYCLE_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=Lifecycle,ServiceName=InstallationService"; // NOI18N
37.260 + public static final String JBI_LOGGING_SERVICE_LIFECYCLE_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=Lifecycle,ServiceName=LoggingService"; // NOI18N
37.261 + public static final String JBI_MESSAGE_SERVICE_LIFECYCLE_OBJECT_NAME = "com.sun.jbi:ComponentType=System,ControlType=Lifecycle,ServiceName=MessageService"; // NOI18N
37.262 +}
38.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
38.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/actions/Bundle.properties Fri Oct 20 12:37:37 2006 +0000
38.3 @@ -0,0 +1,27 @@
38.4 +#
38.5 +# The contents of this file are subject to the terms of the Common Development
38.6 +# and Distribution License (the License). You may not use this file except in
38.7 +# compliance with the License.
38.8 +#
38.9 +# You can obtain a copy of the License at http://www.netbeans.org/cddl.html
38.10 +# or http://www.netbeans.org/cddl.txt.
38.11 +
38.12 +# When distributing Covered Code, include this CDDL Header Notice in each file
38.13 +# and include the License file at http://www.netbeans.org/cddl.txt.
38.14 +# If applicable, add the following below the CDDL Header, with the fields
38.15 +# enclosed by brackets [] replaced by your own identifying information:
38.16 +# "Portions Copyrighted [year] [name of copyright owner]"
38.17 +#
38.18 +# The Original Software is NetBeans. The Initial Developer of the Original
38.19 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
38.20 +# Microsystems, Inc. All Rights Reserved.
38.21 +#
38.22 +LBL_StartAction=Start
38.23 +LBL_StopAction=Stop
38.24 +LBL_ShutdownAction=Shutdown
38.25 +LBL_UninstallAction=Uninstall
38.26 +LBL_UndeployAction=Undeploy
38.27 +LBL_InstallServiceEngineAction=Install New Service Engine
38.28 +LBL_InstallBindingComponentAction=Install New Binding Component
38.29 +LBL_InstallSharedLibraryAction=Install New Shared Library
38.30 +LBL_DeployAction=Deploy New Service Assembly
39.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
39.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/actions/DeployAction.java Fri Oct 20 12:37:37 2006 +0000
39.3 @@ -0,0 +1,107 @@
39.4 +/*
39.5 + * The contents of this file are subject to the terms of the Common Development
39.6 + * and Distribution License (the License). You may not use this file except in
39.7 + * compliance with the License.
39.8 + *
39.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
39.10 + * or http://www.netbeans.org/cddl.txt.
39.11 +
39.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
39.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
39.14 + * If applicable, add the following below the CDDL Header, with the fields
39.15 + * enclosed by brackets [] replaced by your own identifying information:
39.16 + * "Portions Copyrighted [year] [name of copyright owner]"
39.17 + *
39.18 + * The Original Software is NetBeans. The Initial Developer of the Original
39.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
39.20 + * Microsystems, Inc. All Rights Reserved.
39.21 + */
39.22 +
39.23 +package org.netbeans.modules.sun.manager.jbi.actions;
39.24 +
39.25 +import javax.swing.SwingUtilities;
39.26 +
39.27 +import org.netbeans.modules.j2ee.sun.bridge.apis.RefreshCookie;
39.28 +import org.netbeans.modules.sun.manager.jbi.nodes.Deployable;
39.29 +import org.openide.nodes.Node;
39.30 +import org.openide.util.HelpCtx;
39.31 +import org.openide.util.Lookup;
39.32 +import org.openide.util.NbBundle;
39.33 +import org.openide.util.RequestProcessor;
39.34 +import org.openide.util.actions.NodeAction;
39.35 +
39.36 +/**
39.37 + *
39.38 + * @author jqian
39.39 + */
39.40 +public class DeployAction extends NodeAction {
39.41 +
39.42 + /**
39.43 + *
39.44 + *
39.45 + */
39.46 + protected void performAction(Node[] activatedNodes) {
39.47 + final Node node = activatedNodes[0];
39.48 + Lookup lookup = node.getLookup();
39.49 + final Object obj = lookup.lookup(Deployable.class);
39.50 +
39.51 + RequestProcessor.getDefault().post(new Runnable() {
39.52 + public void run() {
39.53 + try {
39.54 + if (obj instanceof Deployable) {
39.55 + Deployable deployable = (Deployable)obj;
39.56 + deployable.deploy();
39.57 +
39.58 + SwingUtilities.invokeLater(new Runnable() {
39.59 + public void run() {
39.60 + RefreshCookie refreshAction =
39.61 + (RefreshCookie) node.getCookie(
39.62 + RefreshCookie.class);
39.63 + if (refreshAction != null){
39.64 + refreshAction.refresh();
39.65 + }
39.66 + }
39.67 + });
39.68 + }
39.69 + } catch(java.lang.RuntimeException rex) {
39.70 + //gobble up exception
39.71 + }
39.72 + }
39.73 + });
39.74 + }
39.75 +
39.76 + /**
39.77 + *
39.78 + *
39.79 + */
39.80 + protected boolean enable(Node[] nodes) {
39.81 + return nodes != null && nodes.length == 1;
39.82 + }
39.83 +
39.84 +
39.85 + /**
39.86 + *
39.87 + *
39.88 + */
39.89 + protected boolean asynchronous() {
39.90 + return false;
39.91 + }
39.92 +
39.93 +
39.94 + /**
39.95 + *
39.96 + *
39.97 + */
39.98 + public HelpCtx getHelpCtx() {
39.99 + return HelpCtx.DEFAULT_HELP;
39.100 + }
39.101 +
39.102 +
39.103 + /**
39.104 + *
39.105 + */
39.106 + public String getName() {
39.107 + return NbBundle.getMessage(DeployAction.class, "LBL_DeployAction"); // NOI18N
39.108 + }
39.109 +
39.110 +}
40.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
40.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/actions/InstallAction.java Fri Oct 20 12:37:37 2006 +0000
40.3 @@ -0,0 +1,130 @@
40.4 +/*
40.5 + * The contents of this file are subject to the terms of the Common Development
40.6 + * and Distribution License (the License). You may not use this file except in
40.7 + * compliance with the License.
40.8 + *
40.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
40.10 + * or http://www.netbeans.org/cddl.txt.
40.11 +
40.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
40.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
40.14 + * If applicable, add the following below the CDDL Header, with the fields
40.15 + * enclosed by brackets [] replaced by your own identifying information:
40.16 + * "Portions Copyrighted [year] [name of copyright owner]"
40.17 + *
40.18 + * The Original Software is NetBeans. The Initial Developer of the Original
40.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
40.20 + * Microsystems, Inc. All Rights Reserved.
40.21 + */
40.22 +
40.23 +package org.netbeans.modules.sun.manager.jbi.actions;
40.24 +
40.25 +import javax.swing.SwingUtilities;
40.26 +
40.27 +import org.netbeans.modules.j2ee.sun.bridge.apis.RefreshCookie;
40.28 +import org.netbeans.modules.sun.manager.jbi.nodes.Installable;
40.29 +import org.openide.nodes.Node;
40.30 +import org.openide.util.HelpCtx;
40.31 +import org.openide.util.Lookup;
40.32 +import org.openide.util.NbBundle;
40.33 +import org.openide.util.RequestProcessor;
40.34 +import org.openide.util.actions.NodeAction;
40.35 +
40.36 +/**
40.37 + *
40.38 + * @author jqian
40.39 + */
40.40 +public abstract class InstallAction extends NodeAction {
40.41 +
40.42 + /**
40.43 + *
40.44 + *
40.45 + */
40.46 + protected void performAction(Node[] activatedNodes) {
40.47 + final Node node = activatedNodes[0];
40.48 + Lookup lookup = node.getLookup();
40.49 + final Object obj = lookup.lookup(Installable.class);
40.50 +
40.51 + RequestProcessor.getDefault().post(new Runnable() {
40.52 + public void run() {
40.53 + try {
40.54 + if (obj instanceof Installable) {
40.55 + Installable installable = (Installable)obj;
40.56 + installable.install();
40.57 +
40.58 + SwingUtilities.invokeLater(new Runnable() {
40.59 + public void run() {
40.60 + RefreshCookie refreshAction =
40.61 + (RefreshCookie) node.getCookie(
40.62 + RefreshCookie.class);
40.63 + if (refreshAction != null){
40.64 + refreshAction.refresh();
40.65 + }
40.66 + }
40.67 + });
40.68 + }
40.69 + } catch(java.lang.RuntimeException rex) {
40.70 + //gobble up exception
40.71 + }
40.72 + }
40.73 + });
40.74 + }
40.75 +
40.76 + /**
40.77 + *
40.78 + *
40.79 + */
40.80 + protected boolean enable(Node[] nodes) {
40.81 + return nodes != null && nodes.length == 1;
40.82 + }
40.83 +
40.84 +
40.85 + /**
40.86 + *
40.87 + *
40.88 + */
40.89 + protected boolean asynchronous() {
40.90 + return false;
40.91 + }
40.92 +
40.93 +
40.94 + /**
40.95 + *
40.96 + *
40.97 + */
40.98 + public HelpCtx getHelpCtx() {
40.99 + return HelpCtx.DEFAULT_HELP;
40.100 + }
40.101 +
40.102 + //==========================================================================
40.103 +
40.104 + /**
40.105 + * Action for installing Service Engine.
40.106 + */
40.107 + public static class ServiceEngine extends InstallAction {
40.108 + public String getName() {
40.109 + return NbBundle.getMessage(InstallAction.class,
40.110 + "LBL_InstallServiceEngineAction"); // NOI18N
40.111 + }
40.112 + }
40.113 +
40.114 + /**
40.115 + * Action for installing Binding Component.
40.116 + */
40.117 + public static class BindingComponent extends InstallAction {
40.118 + public String getName() {
40.119 + return NbBundle.getMessage(InstallAction.class,
40.120 + "LBL_InstallBindingComponentAction"); // NOI18N
40.121 + }
40.122 + }
40.123 +
40.124 + /**
40.125 + * Action for installing Shared Library
40.126 + */
40.127 + public static class SharedLibrary extends InstallAction {
40.128 + public String getName() {
40.129 + return NbBundle.getMessage(InstallAction.class,
40.130 + "LBL_InstallSharedLibraryAction"); // NOI18N
40.131 + }
40.132 + }
40.133 +}
41.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
41.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/actions/ShutdownAction.java Fri Oct 20 12:37:37 2006 +0000
41.3 @@ -0,0 +1,146 @@
41.4 +/*
41.5 + * The contents of this file are subject to the terms of the Common Development
41.6 + * and Distribution License (the License). You may not use this file except in
41.7 + * compliance with the License.
41.8 + *
41.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
41.10 + * or http://www.netbeans.org/cddl.txt.
41.11 +
41.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
41.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
41.14 + * If applicable, add the following below the CDDL Header, with the fields
41.15 + * enclosed by brackets [] replaced by your own identifying information:
41.16 + * "Portions Copyrighted [year] [name of copyright owner]"
41.17 + *
41.18 + * The Original Software is NetBeans. The Initial Developer of the Original
41.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
41.20 + * Microsystems, Inc. All Rights Reserved.
41.21 + */
41.22 +
41.23 +package org.netbeans.modules.sun.manager.jbi.actions;
41.24 +
41.25 +import javax.swing.SwingUtilities;
41.26 +
41.27 +import org.netbeans.modules.j2ee.sun.bridge.apis.RefreshCookie;
41.28 +import org.netbeans.modules.sun.manager.jbi.nodes.Shutdownable;
41.29 +import org.openide.nodes.Node;
41.30 +import org.openide.util.HelpCtx;
41.31 +import org.openide.util.Lookup;
41.32 +import org.openide.util.NbBundle;
41.33 +import org.openide.util.RequestProcessor;
41.34 +import org.openide.util.actions.NodeAction;
41.35 +
41.36 +/**
41.37 + *
41.38 + * @author jqian
41.39 + */
41.40 +public class ShutdownAction extends NodeAction {
41.41 +
41.42 + /**
41.43 + *
41.44 + */
41.45 + protected void performAction(final Node[] activatedNodes) {
41.46 +
41.47 + RequestProcessor.getDefault().post(new Runnable() {
41.48 + public void run() {
41.49 + try {
41.50 + for (int i = 0; i < activatedNodes.length; i++) {
41.51 + Node node = activatedNodes[i];
41.52 + Lookup lookup = node.getLookup();
41.53 + Object obj = lookup.lookup(Shutdownable.class);
41.54 +
41.55 + if (obj instanceof Shutdownable) {
41.56 + Shutdownable shutdownable = (Shutdownable)obj;
41.57 + shutdownable.shutdown();
41.58 +
41.59 +// if (node.getChildren().getNodesCount() > 0) {
41.60 + final RefreshCookie refreshAction =
41.61 + (RefreshCookie) node.getCookie(RefreshCookie.class);
41.62 + if (refreshAction != null){
41.63 + SwingUtilities.invokeLater(new Runnable() {
41.64 + public void run() {
41.65 + refreshAction.refresh();
41.66 + }
41.67 + });
41.68 + }
41.69 +// }
41.70 + }
41.71 + }
41.72 +
41.73 +// if (needRefresh) {
41.74 +// Node parentNode = activatedNodes[0]; //.getParentNode();
41.75 +// if (parentNode != null) {
41.76 +// final RefreshCookie refreshAction =
41.77 +// (RefreshCookie)parentNode.getCookie(RefreshCookie.class);
41.78 +// if (refreshAction != null){
41.79 +// SwingUtilities.invokeLater(new Runnable() {
41.80 +// public void run() {
41.81 +// refreshAction.refresh();
41.82 +// }
41.83 +// });
41.84 +// }
41.85 +// }
41.86 +// }
41.87 + } catch(java.lang.RuntimeException rex) {
41.88 + //gobble up exception
41.89 + }
41.90 + }
41.91 + });
41.92 + }
41.93 +
41.94 +
41.95 + protected boolean enable(Node[] nodes) {
41.96 + boolean ret = false;
41.97 +
41.98 + if (nodes != null && nodes.length > 0) {
41.99 +
41.100 + ret = true;
41.101 +
41.102 + for (int i = 0; i < nodes.length; i++) {
41.103 + Node node = nodes[i];
41.104 + Lookup lookup = node.getLookup();
41.105 + Object obj = lookup.lookup(Shutdownable.class);
41.106 +
41.107 + try {
41.108 + if(obj instanceof Shutdownable) {
41.109 + Shutdownable shutdownable = (Shutdownable)obj;
41.110 + if (!shutdownable.canShutdown()) {
41.111 + ret = false;
41.112 + break;
41.113 + }
41.114 + }
41.115 + } catch(java.lang.RuntimeException rex) {
41.116 + //gobble up exception
41.117 + }
41.118 + }
41.119 + }
41.120 +
41.121 + return ret;
41.122 + }
41.123 +
41.124 + /**
41.125 + *
41.126 + *
41.127 + */
41.128 + protected boolean asynchronous() {
41.129 + return false;
41.130 + }
41.131 +
41.132 +
41.133 + /**
41.134 + *
41.135 + *
41.136 + */
41.137 + public HelpCtx getHelpCtx() {
41.138 + return HelpCtx.DEFAULT_HELP;
41.139 + }
41.140 +
41.141 +
41.142 + /**
41.143 + *
41.144 + */
41.145 + public String getName() {
41.146 + return NbBundle.getMessage(ShutdownAction.class, "LBL_ShutdownAction"); // NOI18N
41.147 + }
41.148 +
41.149 +}
42.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
42.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/actions/StartAction.java Fri Oct 20 12:37:37 2006 +0000
42.3 @@ -0,0 +1,143 @@
42.4 +/*
42.5 + * The contents of this file are subject to the terms of the Common Development
42.6 + * and Distribution License (the License). You may not use this file except in
42.7 + * compliance with the License.
42.8 + *
42.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
42.10 + * or http://www.netbeans.org/cddl.txt.
42.11 +
42.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
42.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
42.14 + * If applicable, add the following below the CDDL Header, with the fields
42.15 + * enclosed by brackets [] replaced by your own identifying information:
42.16 + * "Portions Copyrighted [year] [name of copyright owner]"
42.17 + *
42.18 + * The Original Software is NetBeans. The Initial Developer of the Original
42.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
42.20 + * Microsystems, Inc. All Rights Reserved.
42.21 + */
42.22 +
42.23 +package org.netbeans.modules.sun.manager.jbi.actions;
42.24 +
42.25 +import javax.swing.SwingUtilities;
42.26 +
42.27 +import org.netbeans.modules.j2ee.sun.bridge.apis.RefreshCookie;
42.28 +import org.netbeans.modules.sun.manager.jbi.nodes.Startable;
42.29 +import org.openide.nodes.Node;
42.30 +import org.openide.util.HelpCtx;
42.31 +import org.openide.util.Lookup;
42.32 +import org.openide.util.NbBundle;
42.33 +import org.openide.util.RequestProcessor;
42.34 +import org.openide.util.actions.NodeAction;
42.35 +
42.36 +/**
42.37 + *
42.38 + * @author jqian
42.39 + */
42.40 +public class StartAction extends NodeAction {
42.41 +
42.42 + /**
42.43 + *
42.44 + */
42.45 + protected void performAction(final Node[] activatedNodes) {
42.46 + RequestProcessor.getDefault().post(new Runnable() {
42.47 + public void run() {
42.48 + try {
42.49 + for (int i = 0; i < activatedNodes.length; i++) {
42.50 + Node node = activatedNodes[i];
42.51 + Lookup lookup = node.getLookup();
42.52 + Object obj = lookup.lookup(Startable.class);
42.53 +
42.54 + if (obj instanceof Startable) {
42.55 + Startable startable = (Startable)obj;
42.56 + startable.start();
42.57 +
42.58 +// if (node.getChildren().getNodesCount() > 0) {
42.59 + final RefreshCookie refreshAction =
42.60 + (RefreshCookie) node.getCookie(RefreshCookie.class);
42.61 + if (refreshAction != null){
42.62 + SwingUtilities.invokeLater(new Runnable() {
42.63 + public void run() {
42.64 + refreshAction.refresh();
42.65 + }
42.66 + });
42.67 + }
42.68 +// }
42.69 + }
42.70 + }
42.71 +
42.72 +// if (needRefresh) {
42.73 +// Node parentNode = activatedNodes[0]; //.getParentNode();
42.74 +// if (parentNode != null) {
42.75 +// final RefreshCookie refreshAction =
42.76 +// (RefreshCookie)parentNode.getCookie(RefreshCookie.class);
42.77 +// if (refreshAction != null){
42.78 +// SwingUtilities.invokeLater(new Runnable() {
42.79 +// public void run() {
42.80 +// refreshAction.refresh();
42.81 +// }
42.82 +// });
42.83 +// }
42.84 +// }
42.85 +// }
42.86 + } catch(java.lang.RuntimeException rex) {
42.87 + //gobble up exception
42.88 + }
42.89 + }
42.90 + });
42.91 + }
42.92 +
42.93 + protected boolean enable(Node[] nodes) {
42.94 + boolean ret = false;
42.95 +
42.96 + if (nodes != null && nodes.length > 0) {
42.97 +
42.98 + ret = true;
42.99 +
42.100 + for (int i = 0; i < nodes.length; i++) {
42.101 + Node node = nodes[i];
42.102 + Lookup lookup = node.getLookup();
42.103 + Object obj = lookup.lookup(Startable.class);
42.104 +
42.105 + try {
42.106 + if(obj instanceof Startable) {
42.107 + Startable startable = (Startable)obj;
42.108 + if (!startable.canStart()) {
42.109 + ret = false;
42.110 + break;
42.111 + }
42.112 + }
42.113 + } catch(java.lang.RuntimeException rex) {
42.114 + //gobble up exception
42.115 + }
42.116 + }
42.117 + }
42.118 +
42.119 + return ret;
42.120 + }
42.121 +
42.122 + /**
42.123 + *
42.124 + *
42.125 + */
42.126 + protected boolean asynchronous() {
42.127 + return false;
42.128 + }
42.129 +
42.130 +
42.131 + /**
42.132 + *
42.133 + *
42.134 + */
42.135 + public HelpCtx getHelpCtx() {
42.136 + return HelpCtx.DEFAULT_HELP;
42.137 + }
42.138 +
42.139 + /**
42.140 + *
42.141 + */
42.142 + public String getName() {
42.143 + return NbBundle.getMessage(StartAction.class, "LBL_StartAction"); // NOI18N
42.144 + }
42.145 +
42.146 +}
43.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
43.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/actions/StopAction.java Fri Oct 20 12:37:37 2006 +0000
43.3 @@ -0,0 +1,144 @@
43.4 +/*
43.5 + * The contents of this file are subject to the terms of the Common Development
43.6 + * and Distribution License (the License). You may not use this file except in
43.7 + * compliance with the License.
43.8 + *
43.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
43.10 + * or http://www.netbeans.org/cddl.txt.
43.11 +
43.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
43.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
43.14 + * If applicable, add the following below the CDDL Header, with the fields
43.15 + * enclosed by brackets [] replaced by your own identifying information:
43.16 + * "Portions Copyrighted [year] [name of copyright owner]"
43.17 + *
43.18 + * The Original Software is NetBeans. The Initial Developer of the Original
43.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
43.20 + * Microsystems, Inc. All Rights Reserved.
43.21 + */
43.22 +
43.23 +package org.netbeans.modules.sun.manager.jbi.actions;
43.24 +
43.25 +import javax.swing.SwingUtilities;
43.26 +
43.27 +import org.netbeans.modules.j2ee.sun.bridge.apis.RefreshCookie;
43.28 +import org.netbeans.modules.sun.manager.jbi.nodes.Stoppable;
43.29 +import org.openide.nodes.Node;
43.30 +import org.openide.util.HelpCtx;
43.31 +import org.openide.util.Lookup;
43.32 +import org.openide.util.NbBundle;
43.33 +import org.openide.util.RequestProcessor;
43.34 +import org.openide.util.actions.NodeAction;
43.35 +
43.36 +/**
43.37 + *
43.38 + * @author jqian
43.39 + */
43.40 +public class StopAction extends NodeAction {
43.41 +
43.42 + /**
43.43 + *
43.44 + */
43.45 + protected void performAction(final Node[] activatedNodes) {
43.46 +
43.47 + RequestProcessor.getDefault().post(new Runnable() {
43.48 + public void run() {
43.49 + try {
43.50 + for (int i = 0; i < activatedNodes.length; i++) {
43.51 + Node node = activatedNodes[i];
43.52 + Lookup lookup = node.getLookup();
43.53 + Object obj = lookup.lookup(Stoppable.class);
43.54 +
43.55 + if (obj instanceof Stoppable) {
43.56 + Stoppable stoppable = (Stoppable)obj;
43.57 + stoppable.stop();
43.58 +
43.59 +// if (node.getChildren().getNodesCount() > 0) {
43.60 + final RefreshCookie refreshAction =
43.61 + (RefreshCookie) node.getCookie(RefreshCookie.class);
43.62 + if (refreshAction != null){
43.63 + SwingUtilities.invokeLater(new Runnable() {
43.64 + public void run() {
43.65 + refreshAction.refresh();
43.66 + }
43.67 + });
43.68 + }
43.69 +// }
43.70 + }
43.71 + }
43.72 +
43.73 +// if (needRefresh) {
43.74 +// Node parentNode = activatedNodes[0]; //.getParentNode();
43.75 +// if (parentNode != null) {
43.76 +// final RefreshCookie refreshAction =
43.77 +// (RefreshCookie)parentNode.getCookie(RefreshCookie.class);
43.78 +// if (refreshAction != null){
43.79 +// SwingUtilities.invokeLater(new Runnable() {
43.80 +// public void run() {
43.81 +// refreshAction.refresh();
43.82 +// }
43.83 +// });
43.84 +// }
43.85 +// }
43.86 +// }
43.87 + } catch(java.lang.RuntimeException rex) {
43.88 + //gobble up exception
43.89 + }
43.90 + }
43.91 + });
43.92 + }
43.93 +
43.94 + protected boolean enable(Node[] nodes) {
43.95 + boolean ret = false;
43.96 +
43.97 + if (nodes != null && nodes.length > 0) {
43.98 +
43.99 + ret = true;
43.100 +
43.101 + for (int i = 0; i < nodes.length; i++) {
43.102 + Node node = nodes[i];
43.103 + Lookup lookup = node.getLookup();
43.104 + Object obj = lookup.lookup(Stoppable.class);
43.105 +
43.106 + try {
43.107 + if(obj instanceof Stoppable) {
43.108 + Stoppable stopable = (Stoppable)obj;
43.109 + if (!stopable.canStop()) {
43.110 + ret = false;
43.111 + break;
43.112 + }
43.113 + }
43.114 + } catch(java.lang.RuntimeException rex) {
43.115 + //gobble up exception
43.116 + }
43.117 + }
43.118 + }
43.119 +
43.120 + return ret;
43.121 + }
43.122 +
43.123 + /**
43.124 + *
43.125 + *
43.126 + */
43.127 + protected boolean asynchronous() {
43.128 + return false;
43.129 + }
43.130 +
43.131 +
43.132 + /**
43.133 + *
43.134 + *
43.135 + */
43.136 + public HelpCtx getHelpCtx() {
43.137 + return HelpCtx.DEFAULT_HELP;
43.138 + }
43.139 +
43.140 + /**
43.141 + *
43.142 + */
43.143 + public String getName() {
43.144 + return NbBundle.getMessage(StopAction.class, "LBL_StopAction"); // NOI18N
43.145 + }
43.146 +
43.147 +}
44.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
44.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/actions/UndeployAction.java Fri Oct 20 12:37:37 2006 +0000
44.3 @@ -0,0 +1,142 @@
44.4 +/*
44.5 + * The contents of this file are subject to the terms of the Common Development
44.6 + * and Distribution License (the License). You may not use this file except in
44.7 + * compliance with the License.
44.8 + *
44.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
44.10 + * or http://www.netbeans.org/cddl.txt.
44.11 +
44.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
44.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
44.14 + * If applicable, add the following below the CDDL Header, with the fields
44.15 + * enclosed by brackets [] replaced by your own identifying information:
44.16 + * "Portions Copyrighted [year] [name of copyright owner]"
44.17 + *
44.18 + * The Original Software is NetBeans. The Initial Developer of the Original
44.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
44.20 + * Microsystems, Inc. All Rights Reserved.
44.21 + */
44.22 +
44.23 +package org.netbeans.modules.sun.manager.jbi.actions;
44.24 +
44.25 +import javax.swing.SwingUtilities;
44.26 +
44.27 +import org.netbeans.modules.j2ee.sun.bridge.apis.RefreshCookie;
44.28 +import org.netbeans.modules.sun.manager.jbi.nodes.Undeployable;
44.29 +import org.openide.nodes.Node;
44.30 +import org.openide.util.HelpCtx;
44.31 +import org.openide.util.Lookup;
44.32 +import org.openide.util.NbBundle;
44.33 +import org.openide.util.RequestProcessor;
44.34 +import org.openide.util.actions.NodeAction;
44.35 +
44.36 +/**
44.37 + *
44.38 + * @author jqian
44.39 + */
44.40 +public class UndeployAction extends NodeAction {
44.41 +
44.42 + /**
44.43 + *
44.44 + *
44.45 + */
44.46 + protected void performAction(final Node[] activatedNodes) {
44.47 + RequestProcessor.getDefault().post(new Runnable() {
44.48 + public void run() {
44.49 + try {
44.50 + Node parentNode = null; // the node that needs refreshing
44.51 + for (int i = 0; i < activatedNodes.length; i++) {
44.52 + Node node = activatedNodes[i];
44.53 + Lookup lookup = node.getLookup();
44.54 + Object obj = lookup.lookup(Undeployable.class);
44.55 +
44.56 + if (obj instanceof Undeployable) {
44.57 + Undeployable undeployable = (Undeployable)obj;
44.58 + undeployable.undeploy();
44.59 + // There will be at most one parent node that
44.60 + // needs refreshing
44.61 + if (parentNode == null) {
44.62 + parentNode = node.getParentNode();
44.63 + }
44.64 + }
44.65 + }
44.66 +
44.67 + if (parentNode != null) {
44.68 + final RefreshCookie refreshAction =
44.69 + (RefreshCookie) parentNode.getCookie(RefreshCookie.class);
44.70 + if (refreshAction != null){
44.71 + SwingUtilities.invokeLater(new Runnable() {
44.72 + public void run() {
44.73 + refreshAction.refresh();
44.74 + }
44.75 + });
44.76 + }
44.77 + }
44.78 + } catch(java.lang.RuntimeException rex) {
44.79 + //gobble up exception
44.80 + }
44.81 + }
44.82 + });
44.83 + }
44.84 +
44.85 +
44.86 + /**
44.87 + *
44.88 + *
44.89 + */
44.90 + protected boolean enable(Node[] nodes) {
44.91 + boolean ret = false;
44.92 +
44.93 + if (nodes != null && nodes.length > 0) {
44.94 +
44.95 + ret = true;
44.96 +
44.97 + for (int i = 0; i < nodes.length; i++) {
44.98 + Node node = nodes[i];
44.99 + Lookup lookup = node.getLookup();
44.100 + Object obj = lookup.lookup(Undeployable.class);
44.101 +
44.102 + try {
44.103 + if(obj instanceof Undeployable) {
44.104 + Undeployable undeployable = (Undeployable)obj;
44.105 + if (!undeployable.canUndeploy()) {
44.106 + ret = false;
44.107 + break;
44.108 + }
44.109 + }
44.110 + } catch(java.lang.RuntimeException rex) {
44.111 + //gobble up exception
44.112 + }
44.113 + }
44.114 + }
44.115 +
44.116 + return ret;
44.117 + }
44.118 +
44.119 +
44.120 + /**
44.121 + *
44.122 + *
44.123 + */
44.124 + protected boolean asynchronous() {
44.125 + return false;
44.126 + }
44.127 +
44.128 +
44.129 + /**
44.130 + *
44.131 + *
44.132 + */
44.133 + public HelpCtx getHelpCtx() {
44.134 + return HelpCtx.DEFAULT_HELP;
44.135 + }
44.136 +
44.137 +
44.138 + /**
44.139 + *
44.140 + */
44.141 + public String getName() {
44.142 + return NbBundle.getMessage(UndeployAction.class, "LBL_UndeployAction"); // NOI18N
44.143 + }
44.144 +
44.145 +}
45.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
45.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/actions/UninstallAction.java Fri Oct 20 12:37:37 2006 +0000
45.3 @@ -0,0 +1,142 @@
45.4 +/*
45.5 + * The contents of this file are subject to the terms of the Common Development
45.6 + * and Distribution License (the License). You may not use this file except in
45.7 + * compliance with the License.
45.8 + *
45.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
45.10 + * or http://www.netbeans.org/cddl.txt.
45.11 +
45.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
45.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
45.14 + * If applicable, add the following below the CDDL Header, with the fields
45.15 + * enclosed by brackets [] replaced by your own identifying information:
45.16 + * "Portions Copyrighted [year] [name of copyright owner]"
45.17 + *
45.18 + * The Original Software is NetBeans. The Initial Developer of the Original
45.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
45.20 + * Microsystems, Inc. All Rights Reserved.
45.21 + */
45.22 +
45.23 +package org.netbeans.modules.sun.manager.jbi.actions;
45.24 +
45.25 +import java.util.ArrayList;
45.26 +import java.util.Iterator;
45.27 +import java.util.List;
45.28 +import javax.swing.SwingUtilities;
45.29 +
45.30 +import org.netbeans.modules.j2ee.sun.bridge.apis.RefreshCookie;
45.31 +import org.netbeans.modules.sun.manager.jbi.nodes.Uninstallable;
45.32 +import org.openide.nodes.Node;
45.33 +import org.openide.util.HelpCtx;
45.34 +import org.openide.util.Lookup;
45.35 +import org.openide.util.NbBundle;
45.36 +import org.openide.util.RequestProcessor;
45.37 +import org.openide.util.actions.NodeAction;
45.38 +
45.39 +/**
45.40 + *
45.41 + * @author jqian
45.42 + */
45.43 +public class UninstallAction extends NodeAction {
45.44 +
45.45 + /**
45.46 + *
45.47 + */
45.48 + protected void performAction(final Node[] activatedNodes) {
45.49 + RequestProcessor.getDefault().post(new Runnable() {
45.50 + public void run() {
45.51 + try {
45.52 + // a list of nodes that need refreshing
45.53 + final List<Node> parentNodes = new ArrayList<Node>();
45.54 + for (int i = 0; i < activatedNodes.length; i++) {
45.55 + Node node = activatedNodes[i];
45.56 + Lookup lookup = node.getLookup();
45.57 + Object obj = lookup.lookup(Uninstallable.class);
45.58 +
45.59 + if (obj instanceof Uninstallable) {
45.60 + Uninstallable uninstallable = (Uninstallable)obj;
45.61 + uninstallable.uninstall();
45.62 + // There will be at most one parent node that
45.63 + // needs refreshing
45.64 + Node parentNode = node.getParentNode();
45.65 + if (!parentNodes.contains(parentNode)) {
45.66 + parentNodes.add(parentNode);
45.67 + }
45.68 + }
45.69 + }
45.70 +
45.71 + SwingUtilities.invokeLater(new Runnable() {
45.72 + public void run() {
45.73 + for (Iterator<Node> it = parentNodes.iterator(); it.hasNext();) {
45.74 + Node parentNode = it.next();
45.75 + final RefreshCookie refreshAction =
45.76 + (RefreshCookie) parentNode.getCookie(RefreshCookie.class);
45.77 + if (refreshAction != null){
45.78 + refreshAction.refresh();
45.79 + }
45.80 + }
45.81 + }
45.82 + });
45.83 +
45.84 + } catch(java.lang.RuntimeException rex) {
45.85 + //gobble up exception
45.86 + }
45.87 + }
45.88 + });
45.89 + }
45.90 +
45.91 + protected boolean enable(Node[] nodes) {
45.92 + boolean ret = false;
45.93 +
45.94 + if (nodes != null && nodes.length > 0) {
45.95 +
45.96 + ret = true;
45.97 +
45.98 + for (int i = 0; i < nodes.length; i++) {
45.99 + Node node = nodes[i];
45.100 + Lookup lookup = node.getLookup();
45.101 + Object obj = lookup.lookup(Uninstallable.class);
45.102 +
45.103 + try {
45.104 + if(obj instanceof Uninstallable) {
45.105 + Uninstallable uninstallable = (Uninstallable)obj;
45.106 + if (!uninstallable.canUninstall()) {
45.107 + ret = false;
45.108 + break;
45.109 + }
45.110 + }
45.111 + } catch(java.lang.RuntimeException rex) {
45.112 + //gobble up exception
45.113 + }
45.114 + }
45.115 + }
45.116 +
45.117 + return ret;
45.118 + }
45.119 +
45.120 + /**
45.121 + *
45.122 + *
45.123 + */
45.124 + protected boolean asynchronous() {
45.125 + return false;
45.126 + }
45.127 +
45.128 +
45.129 + /**
45.130 + *
45.131 + *
45.132 + */
45.133 + public HelpCtx getHelpCtx() {
45.134 + return HelpCtx.DEFAULT_HELP;
45.135 + }
45.136 +
45.137 +
45.138 + /**
45.139 + *
45.140 + */
45.141 + public String getName() {
45.142 + return NbBundle.getMessage(UninstallAction.class, "LBL_UninstallAction"); // NOI18N
45.143 + }
45.144 +
45.145 +}
46.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
46.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/editors/JBILogLevelEditor.java Fri Oct 20 12:37:37 2006 +0000
46.3 @@ -0,0 +1,97 @@
46.4 +/*
46.5 + * The contents of this file are subject to the terms of the Common Development
46.6 + * and Distribution License (the License). You may not use this file except in
46.7 + * compliance with the License.
46.8 + *
46.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
46.10 + * or http://www.netbeans.org/cddl.txt.
46.11 +
46.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
46.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
46.14 + * If applicable, add the following below the CDDL Header, with the fields
46.15 + * enclosed by brackets [] replaced by your own identifying information:
46.16 + * "Portions Copyrighted [year] [name of copyright owner]"
46.17 + *
46.18 + * The Original Software is NetBeans. The Initial Developer of the Original
46.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
46.20 + * Microsystems, Inc. All Rights Reserved.
46.21 + */
46.22 +
46.23 +package org.netbeans.modules.sun.manager.jbi.editors;
46.24 +
46.25 +import java.awt.Component;
46.26 +import java.beans.PropertyEditorSupport;
46.27 +import org.openide.explorer.propertysheet.editors.EnhancedPropertyEditor;
46.28 +
46.29 +/**
46.30 + * Custom Editor for Server component's log levels
46.31 + * @author ludo
46.32 + * @author nityad
46.33 + */
46.34 +public class JBILogLevelEditor extends PropertyEditorSupport implements EnhancedPropertyEditor {
46.35 +
46.36 + public String curr_Sel;
46.37 + public String[] choices = {
46.38 + "FINEST", // NOI18N
46.39 + "FINER", // NOI18N
46.40 + "FINE", // NOI18N
46.41 + "INFO", // NOI18N
46.42 + "WARNING", // NOI18N
46.43 + "SEVERE", // NOI18N
46.44 + "OFF", // NOI18N
46.45 + };
46.46 +
46.47 + public JBILogLevelEditor() {
46.48 + curr_Sel = null;
46.49 + }
46.50 +
46.51 + public String getAsText() {
46.52 + return curr_Sel;
46.53 + }
46.54 +
46.55 + public void setAsText(String string) throws IllegalArgumentException {
46.56 + if((string==null)||(string.equals(""))) // NOI18N
46.57 + throw new IllegalArgumentException();
46.58 + else
46.59 + curr_Sel = string;
46.60 + this.firePropertyChange();
46.61 + }
46.62 +
46.63 + public void setValue(Object val) {
46.64 + if (! (val instanceof String)) {
46.65 + throw new IllegalArgumentException();
46.66 + }
46.67 +
46.68 + curr_Sel = (String) val;
46.69 + super.setValue(curr_Sel);
46.70 + }
46.71 +
46.72 + public Object getValue() {
46.73 + return curr_Sel;
46.74 + }
46.75 +
46.76 + public String getJavaInitializationString() {
46.77 + return getAsText();
46.78 + }
46.79 +
46.80 + public String[] getTags() {
46.81 + return choices;
46.82 + }
46.83 +
46.84 + public Component getInPlaceCustomEditor() {
46.85 + return null;
46.86 + }
46.87 +
46.88 +
46.89 + public boolean hasInPlaceCustomEditor() {
46.90 + return false;
46.91 + }
46.92 +
46.93 + public boolean supportsEditingTaggedValues() {
46.94 + return false;
46.95 + }
46.96 +
46.97 +}
46.98 +
46.99 +
46.100 +
47.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
47.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/editors/PasswordEditor.java Fri Oct 20 12:37:37 2006 +0000
47.3 @@ -0,0 +1,104 @@
47.4 +/*
47.5 + * The contents of this file are subject to the terms of the Common Development
47.6 + * and Distribution License (the License). You may not use this file except in
47.7 + * compliance with the License.
47.8 + *
47.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
47.10 + * or http://www.netbeans.org/cddl.txt.
47.11 +
47.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
47.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
47.14 + * If applicable, add the following below the CDDL Header, with the fields
47.15 + * enclosed by brackets [] replaced by your own identifying information:
47.16 + * "Portions Copyrighted [year] [name of copyright owner]"
47.17 + *
47.18 + * The Original Software is NetBeans. The Initial Developer of the Original
47.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
47.20 + * Microsystems, Inc. All Rights Reserved.
47.21 + */
47.22 +
47.23 +package org.netbeans.modules.sun.manager.jbi.editors;
47.24 +
47.25 +
47.26 +import java.awt.Component;
47.27 +import java.awt.KeyboardFocusManager;
47.28 +import java.awt.event.KeyAdapter;
47.29 +import java.awt.event.KeyEvent;
47.30 +import java.beans.PropertyEditorSupport;
47.31 +
47.32 +import javax.swing.JPasswordField;
47.33 +
47.34 +import org.openide.explorer.propertysheet.editors.EnhancedPropertyEditor;
47.35 +
47.36 +/**
47.37 + *
47.38 + * @author nityad
47.39 + */
47.40 +
47.41 +public class PasswordEditor extends PropertyEditorSupport
47.42 + implements EnhancedPropertyEditor {
47.43 +
47.44 + private String value;
47.45 +
47.46 + public String getAsText() {
47.47 + if (value != null) {
47.48 + return value.replaceAll(".", "*"); // NOI18N
47.49 + } else {
47.50 + return null;
47.51 + }
47.52 + }
47.53 +
47.54 + public void setAsText(String value) throws IllegalArgumentException {
47.55 + if (value != null && !value.trim().equals("")){ // NOI18N
47.56 + this.value = value;
47.57 + firePropertyChange();
47.58 + }
47.59 + }
47.60 +
47.61 + public void setValue(Object value) {
47.62 +// this.value = (String) value;
47.63 + setAsText((String)value);
47.64 + }
47.65 +
47.66 + public Object getValue() {
47.67 + return value;
47.68 + }
47.69 +
47.70 + public Component getInPlaceCustomEditor() {
47.71 + JPasswordField textfield = new JPasswordField(value);
47.72 + textfield.setEchoChar('*'); // NOI18N
47.73 + textfield.selectAll();
47.74 + textfield.addKeyListener(new KeyAdapter() {
47.75 + public void keyReleased(KeyEvent evt) {
47.76 + JPasswordField source = (JPasswordField)evt.getSource();
47.77 + // value = new String(source.getPassword());
47.78 + setValue(new String(source.getPassword()));
47.79 + // CR 5055478/6199209 cb.setText(curValue);
47.80 + //firePropertyChange();
47.81 + if (evt.getKeyCode() == KeyEvent.VK_ENTER){
47.82 + KeyEvent esc = new KeyEvent(evt.getComponent(),
47.83 + KeyEvent.KEY_PRESSED, 0, 0,
47.84 + KeyEvent.VK_ESCAPE,
47.85 + KeyEvent.CHAR_UNDEFINED);
47.86 + KeyboardFocusManager.getCurrentKeyboardFocusManager()
47.87 + .dispatchKeyEvent(esc);
47.88 + //firePropertyChange();
47.89 + }
47.90 + }
47.91 + });
47.92 + return textfield;
47.93 + }
47.94 +
47.95 + public boolean hasInPlaceCustomEditor() {
47.96 + return true;
47.97 + }
47.98 +
47.99 + public boolean supportsEditingTaggedValues() {
47.100 + return false;
47.101 + }
47.102 +}
47.103 +
47.104 +
47.105 +
47.106 +
47.107 +
48.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
48.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/layer.xml Fri Oct 20 12:37:37 2006 +0000
48.3 @@ -0,0 +1,34 @@
48.4 +<?xml version="1.0" encoding="UTF-8"?>
48.5 +
48.6 +<!--
48.7 +The contents of this file are subject to the terms of the Common Development
48.8 +and Distribution License (the License). You may not use this file except in
48.9 +compliance with the License.
48.10 +
48.11 + You can obtain a copy of the License at http://www.netbeans.org/cddl.html
48.12 +or http://www.netbeans.org/cddl.txt.
48.13 +
48.14 +When distributing Covered Code, include this CDDL Header Notice in each file
48.15 +and include the License file at http://www.netbeans.org/cddl.txt.
48.16 +If applicable, add the following below the CDDL Header, with the fields
48.17 +enclosed by brackets [] replaced by your own identifying information:
48.18 +"Portions Copyrighted [year] [name of copyright owner]"
48.19 +
48.20 + The Original Software is NetBeans. The Initial Developer of the Original
48.21 +Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
48.22 + Microsystems, Inc. All Rights Reserved.
48.23 +-->
48.24 +
48.25 +<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
48.26 +<filesystem>
48.27 + <folder name="J2EE">
48.28 + <folder name="SunAppServer">
48.29 + <folder name="Bridge">
48.30 + <file name="JBIBridge">
48.31 + <attr name="jar.location" stringvalue="modules/org-netbeans-modules-sun-manager-jbi.jar"/>
48.32 + </file>
48.33 + </folder>
48.34 + </folder>
48.35 + </folder>
48.36 +</filesystem>
48.37 +
49.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
49.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/management/Bundle.properties Fri Oct 20 12:37:37 2006 +0000
49.3 @@ -0,0 +1,40 @@
49.4 +#
49.5 +# The contents of this file are subject to the terms of the Common Development
49.6 +# and Distribution License (the License). You may not use this file except in
49.7 +# compliance with the License.
49.8 +#
49.9 +# You can obtain a copy of the License at http://www.netbeans.org/cddl.html
49.10 +# or http://www.netbeans.org/cddl.txt.
49.11 +
49.12 +# When distributing Covered Code, include this CDDL Header Notice in each file
49.13 +# and include the License file at http://www.netbeans.org/cddl.txt.
49.14 +# If applicable, add the following below the CDDL Header, with the fields
49.15 +# enclosed by brackets [] replaced by your own identifying information:
49.16 +# "Portions Copyrighted [year] [name of copyright owner]"
49.17 +#
49.18 +# The Original Software is NetBeans. The Initial Developer of the Original
49.19 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
49.20 +# Microsystems, Inc. All Rights Reserved.
49.21 +#
49.22 +#Bean Info for JBIFrameworkService
49.23 +LBL_LOG_LEVEL=Log Level
49.24 +LBL_CLASS_NAME=Class Name
49.25 +LBL_CLASSPATH=Classpath
49.26 +LBL_DESCRIPTION=Description
49.27 +LBL_LOAD_ORDER=Load Order
49.28 +LBL_NAME=Name
49.29 +LBL_ENABLED=Enabled
49.30 +LBL_FAILURE_FATAL=Failure Fatal
49.31 +LBL_JBI_FRAMEWORK_ENABLED=JBI Framework Enabled
49.32 +
49.33 +DSC_LOG_LEVEL=JBI log level
49.34 +DSC_CLASS_NAME=JBI class name
49.35 +DSC_CLASSPATH=JBI classpath
49.36 +DSC_DESCRIPTION=Description of the Lifecycle Module
49.37 +DSC_LOAD_ORDER=Load order
49.38 +DSC_NAME=Name of the Lifecycle Module
49.39 +DSC_ENABLED=Is enabled
49.40 +DSC_FAILURE_FATAL=Is failure fatal
49.41 +DSC_JBI_FRAMEWORK_ENABLED=Is JBI framework enabled
49.42 +
49.43 +Connection_Failed=Connection Failed
50.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
50.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/management/JBIFrameworkService.java Fri Oct 20 12:37:37 2006 +0000
50.3 @@ -0,0 +1,589 @@
50.4 +/*
50.5 + * The contents of this file are subject to the terms of the Common Development
50.6 + * and Distribution License (the License). You may not use this file except in
50.7 + * compliance with the License.
50.8 + *
50.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
50.10 + * or http://www.netbeans.org/cddl.txt.
50.11 +
50.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
50.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
50.14 + * If applicable, add the following below the CDDL Header, with the fields
50.15 + * enclosed by brackets [] replaced by your own identifying information:
50.16 + * "Portions Copyrighted [year] [name of copyright owner]"
50.17 + *
50.18 + * The Original Software is NetBeans. The Initial Developer of the Original
50.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
50.20 + * Microsystems, Inc. All Rights Reserved.
50.21 + */
50.22 +
50.23 +package org.netbeans.modules.sun.manager.jbi.management;
50.24 +
50.25 +import java.io.IOException;
50.26 +import java.io.Serializable;
50.27 +import java.util.HashMap;
50.28 +import java.util.Iterator;
50.29 +import java.util.Map;
50.30 +import java.util.Set;
50.31 +
50.32 +import javax.management.Attribute;
50.33 +import javax.management.AttributeNotFoundException;
50.34 +import javax.management.InstanceNotFoundException;
50.35 +import javax.management.MBeanException;
50.36 +import javax.management.MBeanServerConnection;
50.37 +import javax.management.MalformedObjectNameException;
50.38 +import javax.management.ObjectName;
50.39 +import javax.management.QueryExp;
50.40 +import javax.management.ReflectionException;
50.41 +import javax.management.remote.JMXConnector;
50.42 +import javax.management.remote.JMXConnectorFactory;
50.43 +import javax.management.remote.JMXServiceURL;
50.44 +
50.45 +/**
50.46 + * Queries the runtime server to ensure that the JBI Container
50.47 + * is installed and is enabled. The JBI Container is installed as a
50.48 + * Lifecycle module on the server. This class also helps in configuring
50.49 + * the JBI Container at runtime.
50.50 + *
50.51 + * @author Graj
50.52 + *
50.53 + */
50.54 +public class JBIFrameworkService implements Serializable {
50.55 +
50.56 + /**
50.57 + * com.sun.jbi.home
50.58 + */
50.59 + public static final String JBI_CLASS_NAME_KEY = "class-name"; // NOI18N
50.60 +
50.61 + /**
50.62 + * com.sun.jbi.binding.proxy.connection
50.63 + */
50.64 + public static final String JBI_CLASSPATH_KEY = "classpath"; // NOI18N
50.65 +
50.66 + /**
50.67 + * disable-timeout-in-minutes - String - 30
50.68 + */
50.69 + public static final String DESCRIPTION_KEY = "description"; // NOI18N
50.70 +
50.71 + /**
50.72 + * enabled - boolean - true
50.73 + */
50.74 + public static final String ENABLED_KEY = "enabled"; // NOI18N
50.75 +
50.76 + /**
50.77 + * lb-enabled - boolean - false
50.78 + */
50.79 + public static final String IS_FAILURE_FATAL_KEY = "is-failure-fatal"; // NOI18N
50.80 +
50.81 + /**
50.82 + * ref - String - JBIFramework
50.83 + */
50.84 + public static final String LOAD_ORDER_KEY = "load-order"; // NOI18N
50.85 +
50.86 + /**
50.87 + * virtual-servers - String
50.88 + */
50.89 + public static final String NAME_KEY = "name"; // NOI18N
50.90 +
50.91 + /**
50.92 + * DOCUMENT ME!
50.93 + */
50.94 + public static final String JBI_CONFIG_OBJECTNAME = "com.sun.appserv:name=JBIFramework,type=lifecycle-module,category=config"; // NOI18N
50.95 +
50.96 + public static final String JBI_LOG_DEFAULT_PROPERTY_NAME = "com.sun.jbi.defaultLogLevel"; // NOI18N
50.97 +
50.98 + public static final String LOG_LEVEL_INFO_KEY = "INFO"; // NOI18N
50.99 + public static final String LOG_LEVEL_FINEST_KEY = "FINEST"; // NOI18N
50.100 + public static final String LOG_LEVEL_FINER_KEY = "FINER"; // NOI18N
50.101 + public static final String LOG_LEVEL_FINE_KEY = "FINE"; // NOI18N
50.102 + public static final String LOG_WARNING_INFO_KEY = "WARNING"; // NOI18N
50.103 + public static final String LOG_SEVERE_INFO_KEY = "SEVERE"; // NOI18N
50.104 + public static final String LOG_OFF_INFO_KEY = "OFF"; // NOI18N
50.105 + /**
50.106 + * DOCUMENT ME!
50.107 + */
50.108 + public static final String JBI_GETPROPERTYVALUE_OPERATION_NAME = "getPropertyValue"; // NOI18N
50.109 + public static final String JBI_SETPROPERTY_OPERATION_NAME = "setProperty"; // NOI18N
50.110 + private MBeanServerConnection serverConnection = null;
50.111 +
50.112 +
50.113 + /**
50.114 + * DOCUMENT ME!
50.115 + */
50.116 + String className;
50.117 +
50.118 + /**
50.119 + * DOCUMENT ME!
50.120 + */
50.121 + String classpath;
50.122 +
50.123 + /**
50.124 + * DOCUMENT ME!
50.125 + */
50.126 + String description;
50.127 +
50.128 + /**
50.129 + * DOCUMENT ME!
50.130 + */
50.131 + boolean enabled;
50.132 +
50.133 + /**
50.134 + * DOCUMENT ME!
50.135 + */
50.136 + boolean failureFatal;
50.137 +
50.138 + /**
50.139 + * DOCUMENT ME!
50.140 + */
50.141 + String loadOrder;
50.142 +
50.143 + /**
50.144 + * DOCUMENT ME!
50.145 + */
50.146 + String name;
50.147 +
50.148 + boolean jbiFrameworkEnabled;
50.149 +
50.150 + boolean isUIMBeanRegistered;
50.151 +
50.152 +
50.153 + /**
50.154 + *
50.155 + */
50.156 + public JBIFrameworkService(MBeanServerConnection connection) {
50.157 + super();
50.158 + this.serverConnection = connection;
50.159 + this.initialize();
50.160 + }
50.161 +
50.162 + /**
50.163 + * DOCUMENT ME!
50.164 + */
50.165 + void initialize() {
50.166 + try {
50.167 + this.jbiInitialize();
50.168 + } catch (MalformedObjectNameException e) {
50.169 + // TODO Auto-generated catch block
50.170 + e.printStackTrace();
50.171 + } catch (AttributeNotFoundException e) {
50.172 + // TODO Auto-generated catch block
50.173 + e.printStackTrace();
50.174 + } catch (InstanceNotFoundException e) {
50.175 + // TODO Auto-generated catch block
50.176 + e.printStackTrace();
50.177 + } catch (NullPointerException e) {
50.178 + // TODO Auto-generated catch block
50.179 + e.printStackTrace();
50.180 + } catch (MBeanException e) {
50.181 + // TODO Auto-generated catch block
50.182 + e.printStackTrace();
50.183 + } catch (ReflectionException e) {
50.184 + // TODO Auto-generated catch block
50.185 + e.printStackTrace();
50.186 + } catch (IOException e) {
50.187 + // TODO Auto-generated catch block
50.188 + e.printStackTrace();
50.189 + }
50.190 + }
50.191 +
50.192 + /**
50.193 + * DOCUMENT ME!
50.194 + *
50.195 + * @throws MalformedObjectNameException DOCUMENT ME!
50.196 + * @throws NullPointerException DOCUMENT ME!
50.197 + * @throws IOException DOCUMENT ME!
50.198 + * @throws InstanceNotFoundException DOCUMENT ME!
50.199 + * @throws MBeanException DOCUMENT ME!
50.200 + * @throws ReflectionException DOCUMENT ME!
50.201 + */
50.202 + void jbiInitialize() throws MalformedObjectNameException, NullPointerException, AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException, IOException {
50.203 + QueryExp queryExpression = null;
50.204 + Set set = null;
50.205 + ObjectName objectName = null;
50.206 + String resultObject = null;
50.207 + objectName = new ObjectName(JBIFrameworkService.JBI_CONFIG_OBJECTNAME);
50.208 + ObjectName uiMBeanObjectName = new ObjectName(AdministrationService.ADMIN_SERVICE_OBJECTNAME);
50.209 +
50.210 + if (this.serverConnection != null) {
50.211 + try {
50.212 + isUIMBeanRegistered = this.serverConnection.isRegistered(uiMBeanObjectName);
50.213 + } catch (IOException ex) {
50.214 + // ignore
50.215 + }
50.216 +
50.217 + set = this.serverConnection.queryNames(objectName, queryExpression);
50.218 +
50.219 + Iterator iterator = set.iterator();
50.220 +
50.221 + if ((iterator != null) && (iterator.hasNext() == true)) {
50.222 + objectName = (ObjectName) iterator.next();
50.223 + }
50.224 +
50.225 + if (objectName != null) {
50.226 +
50.227 + this.className = (String) this.serverConnection.getAttribute(objectName, JBIFrameworkService.JBI_CLASS_NAME_KEY);
50.228 + this.description = (String) this.serverConnection.getAttribute(objectName, JBIFrameworkService.DESCRIPTION_KEY);
50.229 + String value = (String) this.serverConnection.getAttribute(objectName, JBIFrameworkService.ENABLED_KEY);
50.230 + if(value != null) {
50.231 + if(value.equalsIgnoreCase("True") == true) { // NOI18N
50.232 + this.enabled = true;
50.233 + } else {
50.234 + this.enabled = false;
50.235 + }
50.236 + }
50.237 + this.classpath = (String) this.serverConnection.getAttribute(objectName, JBIFrameworkService.JBI_CLASSPATH_KEY);
50.238 + value = (String) this.serverConnection.getAttribute(objectName, JBIFrameworkService.IS_FAILURE_FATAL_KEY);
50.239 + if(value != null) {
50.240 + if(value.equalsIgnoreCase("True") == true) { // NOI18N
50.241 + this.failureFatal = true;
50.242 + } else {
50.243 + this.failureFatal = false;
50.244 + }
50.245 + }
50.246 + this.loadOrder = (String) this.serverConnection.getAttribute(objectName, JBIFrameworkService.LOAD_ORDER_KEY);
50.247 + this.name = (String) this.serverConnection.getAttribute(objectName, JBIFrameworkService.NAME_KEY);
50.248 + this.jbiFrameworkEnabled = true;
50.249 + } else {
50.250 + this.jbiFrameworkEnabled = false;
50.251 + System.out.println("Cound not find the JBI Configuration MBean"); // NOI18N
50.252 + }
50.253 + } else {
50.254 + System.out.println("Could not connect to application server"); // NOI18N
50.255 + }
50.256 + }
50.257 +
50.258 + /**
50.259 + * DOCUMENT ME!
50.260 + *
50.261 + * @param objectName DOCUMENT ME!
50.262 + * @param paramObject DOCUMENT ME!
50.263 + *
50.264 + * @return DOCUMENT ME!
50.265 + *
50.266 + * @throws InstanceNotFoundException DOCUMENT ME!
50.267 + * @throws MBeanException DOCUMENT ME!
50.268 + * @throws ReflectionException DOCUMENT ME!
50.269 + * @throws IOException DOCUMENT ME!
50.270 + */
50.271 + Object invoke(ObjectName objectName, String paramObject) {
50.272 + String operationName = JBIFrameworkService.JBI_GETPROPERTYVALUE_OPERATION_NAME;
50.273 + Object resultObject = null;
50.274 + String[] params = {paramObject};
50.275 + String[] signature = {"java.lang.String"}; // NOI18N
50.276 +
50.277 + try {
50.278 + resultObject = (String) this.serverConnection.invoke(objectName, operationName, params, signature);
50.279 + } catch (InstanceNotFoundException e) {
50.280 + // TODO Auto-generated catch block
50.281 + e.printStackTrace();
50.282 + } catch (MBeanException e) {
50.283 + // TODO Auto-generated catch block
50.284 + e.printStackTrace();
50.285 + } catch (ReflectionException e) {
50.286 + // TODO Auto-generated catch block
50.287 + e.printStackTrace();
50.288 + } catch (IOException e) {
50.289 + // TODO Auto-generated catch block
50.290 + e.printStackTrace();
50.291 + }
50.292 +
50.293 + return resultObject;
50.294 + }
50.295 +
50.296 + /**
50.297 + * DOCUMENT ME!
50.298 + *
50.299 + * @return Returns the serverConnection.
50.300 + */
50.301 + public MBeanServerConnection getServerConnection() {
50.302 + return this.serverConnection;
50.303 + }
50.304 +
50.305 + /**
50.306 + * DOCUMENT ME!
50.307 + *
50.308 + * @param serverConnection The serverConnection to set.
50.309 + */
50.310 +// public void setServerConnection(MBeanServerConnection serverConnection) {
50.311 +// this.serverConnection = serverConnection;
50.312 +// }
50.313 +
50.314 + public String getDefaultLogPropertyValue() {
50.315 + String operationName = JBIFrameworkService.JBI_GETPROPERTYVALUE_OPERATION_NAME;
50.316 + ObjectName objectName = null;
50.317 + try {
50.318 + objectName = new ObjectName(JBIFrameworkService.JBI_CONFIG_OBJECTNAME);
50.319 + } catch (MalformedObjectNameException ex) {
50.320 + ex.printStackTrace();
50.321 + } catch (NullPointerException ex) {
50.322 + ex.printStackTrace();
50.323 + }
50.324 + String resultObject = null;
50.325 + String[] params = {JBIFrameworkService.JBI_LOG_DEFAULT_PROPERTY_NAME};
50.326 + String[] signature = {"java.lang.String"}; // NOI18N
50.327 +
50.328 + try {
50.329 + resultObject = (String) this.serverConnection.invoke(objectName, operationName, params, signature);
50.330 + } catch (InstanceNotFoundException e) {
50.331 + // TODO Auto-generated catch block
50.332 + e.printStackTrace();
50.333 + } catch (MBeanException e) {
50.334 + // TODO Auto-generated catch block
50.335 + e.printStackTrace();
50.336 + } catch (ReflectionException e) {
50.337 + // TODO Auto-generated catch block
50.338 + e.printStackTrace();
50.339 + } catch (IOException e) {
50.340 + // TODO Auto-generated catch block
50.341 + e.printStackTrace();
50.342 + }
50.343 +
50.344 + return resultObject;
50.345 + }
50.346 +
50.347 + public void setDefaultLogPropertyValue(String logLevelString) {
50.348 + String operationName = JBIFrameworkService.JBI_SETPROPERTY_OPERATION_NAME;
50.349 + ObjectName objectName = null;
50.350 + try {
50.351 + objectName = new ObjectName(JBIFrameworkService.JBI_CONFIG_OBJECTNAME);
50.352 + } catch (MalformedObjectNameException ex) {
50.353 + ex.printStackTrace();
50.354 + } catch (NullPointerException ex) {
50.355 + ex.printStackTrace();
50.356 + }
50.357 +
50.358 + Attribute attribute = new Attribute(JBIFrameworkService.JBI_LOG_DEFAULT_PROPERTY_NAME, logLevelString);
50.359 + String resultObject = null;
50.360 + Object[] params = {attribute};
50.361 + String[] signature = {attribute.getClass().getName()};
50.362 +
50.363 + try {
50.364 + resultObject = (String) this.serverConnection.invoke(objectName, operationName, params, signature);
50.365 + } catch (InstanceNotFoundException e) {
50.366 + // TODO Auto-generated catch block
50.367 + e.printStackTrace();
50.368 + } catch (MBeanException e) {
50.369 + // TODO Auto-generated catch block
50.370 + e.printStackTrace();
50.371 + } catch (ReflectionException e) {
50.372 + // TODO Auto-generated catch block
50.373 + e.printStackTrace();
50.374 + } catch (IOException e) {
50.375 + // TODO Auto-generated catch block
50.376 + e.printStackTrace();
50.377 + }
50.378 + }
50.379 +
50.380 + /**
50.381 + * @return Returns the className.
50.382 + */
50.383 + public String getClassName() {
50.384 + return this.className;
50.385 + }
50.386 +
50.387 + /**
50.388 + * @param className The className to set.
50.389 + */
50.390 +// public void setClassName(String className) {
50.391 +// this.className = className;
50.392 +// }
50.393 +
50.394 + /**
50.395 + * @return Returns the classpath.
50.396 + */
50.397 + public String getClasspath() {
50.398 + return this.classpath;
50.399 + }
50.400 +
50.401 + /**
50.402 + * @param classpath The classpath to set.
50.403 + */
50.404 +// public void setClasspath(String classpath) {
50.405 +// this.classpath = classpath;
50.406 +// }
50.407 +
50.408 + /**
50.409 + * @return Returns the description.
50.410 + */
50.411 + public String getDescription() {
50.412 + return this.description;
50.413 + }
50.414 +
50.415 + /**
50.416 + * @param description The description to set.
50.417 + */
50.418 +// public void setDescription(String description) {
50.419 +// this.description = description;
50.420 +// }
50.421 +
50.422 + /**
50.423 + * @return Returns the enabled.
50.424 + */
50.425 + public boolean isEnabled() {
50.426 + return this.enabled;
50.427 + }
50.428 +
50.429 + /**
50.430 + * @param enabled The enabled to set.
50.431 + */
50.432 +// public void setEnabled(boolean enabled) {
50.433 +// this.enabled = enabled;
50.434 +// }
50.435 +
50.436 + /**
50.437 + * @return Returns the failureFatal.
50.438 + */
50.439 + public boolean isFailureFatal() {
50.440 + return this.failureFatal;
50.441 + }
50.442 +
50.443 + /**
50.444 + * @param failureFatal The failureFatal to set.
50.445 + */
50.446 +// public void setFailureFatal(boolean failureFatal) {
50.447 +// this.failureFatal = failureFatal;
50.448 +// }
50.449 +
50.450 + /**
50.451 + * @return Returns the loadOrder.
50.452 + */
50.453 + public String getLoadOrder() {
50.454 + return this.loadOrder;
50.455 + }
50.456 +
50.457 + /**
50.458 + * @param loadOrder The loadOrder to set.
50.459 + */
50.460 +// public void setLoadOrder(String loadOrder) {
50.461 +// this.loadOrder = loadOrder;
50.462 +// }
50.463 +
50.464 + /**
50.465 + * @return Returns the name.
50.466 + */
50.467 + public String getName() {
50.468 + return this.name;
50.469 + }
50.470 +
50.471 + /**
50.472 + * @param name The name to set.
50.473 + */
50.474 +// public void setName(String name) {
50.475 +// this.name = name;
50.476 +// }
50.477 +
50.478 + /**
50.479 + * @return Returns the jbiFrameworkEnabled.
50.480 + */
50.481 + public boolean isJbiFrameworkEnabled() {
50.482 + return this.jbiFrameworkEnabled && this.isUIMBeanRegistered && this.isEnabled();
50.483 + }
50.484 +
50.485 + /**
50.486 + * DOCUMENT ME!
50.487 + */
50.488 + public void printOut() {
50.489 + System.out.println("//////////////////////////////////////////////////////////////////"); // NOI18N
50.490 + System.out.println("// -- JBI Configuration -- //"); // NOI18N
50.491 + System.out.println("//////////////////////////////////////////////////////////////////"); // NOI18N
50.492 + System.out.println("// " + JBIFrameworkService.DESCRIPTION_KEY + " is: " +this.getDescription()); // NOI18N
50.493 + System.out.println("// " + JBIFrameworkService.ENABLED_KEY + " is: " +this.isEnabled()); // NOI18N
50.494 + System.out.println("// " + JBIFrameworkService.IS_FAILURE_FATAL_KEY + " is: " +this.isFailureFatal()); // NOI18N
50.495 + System.out.println("// " + JBIFrameworkService.JBI_CLASS_NAME_KEY + " is: " + this.getClassName()); // NOI18N
50.496 + System.out.println("// " + JBIFrameworkService.JBI_CLASSPATH_KEY + " is: " +this.getClasspath()); // NOI18N
50.497 + System.out.println("// " + JBIFrameworkService.LOAD_ORDER_KEY + " is: " +this.getLoadOrder()); // NOI18N
50.498 + System.out.println("// " + JBIFrameworkService.NAME_KEY + " is: " +this.getName()); // NOI18N
50.499 +
50.500 + System.out.println("//////////////////////////////////////////////////////////////////"); // NOI18N
50.501 + }
50.502 +
50.503 + /**
50.504 + * DOCUMENT ME!
50.505 + *
50.506 + * @return DOCUMENT ME!
50.507 + */
50.508 + public static JBIFrameworkService getJBIConfiguration() {
50.509 + JBIFrameworkService configuration = null;
50.510 + return configuration;
50.511 + }
50.512 +
50.513 + /**
50.514 + *
50.515 + * @param connection
50.516 + */
50.517 + public static void test(MBeanServerConnection connection) {
50.518 + /*
50.519 + String LOG_LEVEL_INFO_KEY = "INFO";
50.520 + String LOG_LEVEL_FINEST_KEY = "FINEST";
50.521 + String LOG_LEVEL_FINER_KEY = "FINER";
50.522 + String LOG_LEVEL_FINE_KEY = "FINE";
50.523 + String LOG_WARNING_INFO_KEY = "WARNING";
50.524 + String LOG_SEVERE_INFO_KEY = "SEVERE";
50.525 + String LOG_OFF_INFO_KEY = "OFF";
50.526 + */
50.527 + if(connection != null) {
50.528 + JBIFrameworkService service = new JBIFrameworkService(connection);
50.529 + service.printOut();
50.530 + if(service.isJbiFrameworkEnabled() == true) {
50.531 + System.out.println("**** JBI Framework is Enabled ****"); // NOI18N
50.532 + } else {
50.533 + System.out.println("**** JBI Framework is NOT Enabled ****"); // NOI18N
50.534 + }
50.535 +
50.536 + String level = service.getDefaultLogPropertyValue();
50.537 + service.setDefaultLogPropertyValue(LOG_SEVERE_INFO_KEY);
50.538 + }
50.539 + }
50.540 +
50.541 +
50.542 +
50.543 + /**
50.544 + * Run an ant script. Starts a separate process to do so. This prevents potential undesireable
50.545 + * interactions, but it also means it should only be used in 'low-frequency' situations to
50.546 + * avoid performance issues with continually creating new processes.
50.547 + *
50.548 + * @param args full path to the ant script file
50.549 + *
50.550 + * @throws Exception DOCUMENT ME!
50.551 + */
50.552 + public static void main(String[] args) throws Exception {
50.553 + String PROTOCOL_CLASS = "com.sun.enterprise.admin.jmx.remote.protocol"; // NOI18N
50.554 + String HTTP_AUTH_PROPERTY_NAME = "com.sun.enterprise.as.http.auth"; // NOI18N
50.555 + String DEFAULT_HTTP_AUTH_SCHEME = "BASIC"; // NOI18N
50.556 + String ADMIN_USER_ENV_PROPERTY_NAME = "USER"; // NOI18N
50.557 + String ADMIN_PASSWORD_ENV_PROPERTY_NAME = "PASSWORD"; // NOI18N
50.558 + String RTS_HTTP_CONNECTOR = "s1ashttp"; // NOI18N
50.559 +
50.560 + String hostName = null;
50.561 + String port = null;
50.562 + String userName = null;
50.563 + String password = null;
50.564 +
50.565 + hostName = "localhost"; // NOI18N
50.566 + port = "4848"; // NOI18N
50.567 + userName = "admin"; // NOI18N
50.568 + password = "adminadmin"; // NOI18N
50.569 +
50.570 + final Map<String, String> environment = new HashMap<String, String>();
50.571 + environment.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, PROTOCOL_CLASS);
50.572 + environment.put(HTTP_AUTH_PROPERTY_NAME, DEFAULT_HTTP_AUTH_SCHEME);
50.573 + environment.put(ADMIN_USER_ENV_PROPERTY_NAME, userName);
50.574 + environment.put(ADMIN_PASSWORD_ENV_PROPERTY_NAME, password);
50.575 +
50.576 + try {
50.577 + int portValue = new Integer(port).intValue();
50.578 + MBeanServerConnection connection = null;
50.579 + JMXServiceURL serviceURL = new JMXServiceURL(RTS_HTTP_CONNECTOR, hostName, portValue);
50.580 + JMXConnector connector = JMXConnectorFactory.connect(serviceURL, environment);
50.581 + connection = connector.getMBeanServerConnection();
50.582 +
50.583 + System.out.println("Connection Retrieved."+connection.toString()); // NOI18N
50.584 + JBIFrameworkService.test(connection);
50.585 +
50.586 + } catch (Exception ex) {
50.587 + ex.printStackTrace();
50.588 + System.out.println("Connection Failed "+ex.getMessage()); // NOI18N
50.589 + }
50.590 +
50.591 + }
50.592 +}
51.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
51.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/management/JBIMBeanTaskResultHandler.java Fri Oct 20 12:37:37 2006 +0000
51.3 @@ -0,0 +1,363 @@
51.4 +/*
51.5 + * The contents of this file are subject to the terms of the Common Development
51.6 + * and Distribution License (the License). You may not use this file except in
51.7 + * compliance with the License.
51.8 + *
51.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
51.10 + * or http://www.netbeans.org/cddl.txt.
51.11 +
51.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
51.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
51.14 + * If applicable, add the following below the CDDL Header, with the fields
51.15 + * enclosed by brackets [] replaced by your own identifying information:
51.16 + * "Portions Copyrighted [year] [name of copyright owner]"
51.17 + *
51.18 + * The Original Software is NetBeans. The Initial Developer of the Original
51.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
51.20 + * Microsystems, Inc. All Rights Reserved.
51.21 + */
51.22 +
51.23 +package org.netbeans.modules.sun.manager.jbi.management;
51.24 +
51.25 +import java.io.File;
51.26 +import java.io.FileReader;
51.27 +import java.io.StringReader;
51.28 +import java.util.List;
51.29 +import java.util.ArrayList;
51.30 +import javax.xml.parsers.DocumentBuilder;
51.31 +import javax.xml.parsers.DocumentBuilderFactory;
51.32 +import javax.xml.xpath.XPath;
51.33 +import javax.xml.xpath.XPathConstants;
51.34 +import javax.xml.xpath.XPathExpressionException;
51.35 +import javax.xml.xpath.XPathFactory;
51.36 +import org.openide.DialogDisplayer;
51.37 +import org.openide.NotifyDescriptor;
51.38 +import org.w3c.dom.Document;
51.39 +import org.w3c.dom.Node;
51.40 +import org.w3c.dom.NodeList;
51.41 +import org.xml.sax.InputSource;
51.42 +
51.43 +/**
51.44 + *
51.45 + * @author jqian
51.46 + */
51.47 +public class JBIMBeanTaskResultHandler {
51.48 +
51.49 + public static final String LINE_SEPARATOR =
51.50 + System.getProperty("line.separator"); // NOI18N
51.51 +
51.52 + /**
51.53 + * @param actionName remote action name
51.54 + * @param target action target (JBI component name,
51.55 + * service assembly name, or the artifact)
51.56 + * @param result remote invocation result
51.57 + */
51.58 + public static void showRemoteInvokationResult(String actionName,
51.59 + String target, String result) {
51.60 +
51.61 + if (result == null || result.trim().length() == 0) {
51.62 + return;
51.63 + }
51.64 +
51.65 + System.out.println(result);
51.66 +
51.67 + StringBuffer ret = new StringBuffer();
51.68 + ret = ret.append("<html>"); // NOI18N
51.69 +
51.70 + boolean failed = false;
51.71 +
51.72 + if (result.indexOf("<?xml") == -1) { // NOI18N
51.73 + // No XML, certain exception (IO) occurred during invoke()
51.74 + if (result.indexOf("Exception") == -1) {
51.75 + return;
51.76 + } else {
51.77 + failed = true;
51.78 + ret = ret.append(result);
51.79 + }
51.80 + } else {
51.81 + // Need to extract info from the XML result
51.82 + result = result.substring(result.indexOf("<?xml")); // NOI18N
51.83 + Document document = getDocument(result);
51.84 +
51.85 + failed = !JBIMBeanTaskResultHandler.isFrameworkTaskResultSuccessful(document);
51.86 +
51.87 + List<TaskResult> frameworkTaskResults =
51.88 + JBIMBeanTaskResultHandler.getTaskResultProblems(document, true);
51.89 +
51.90 + if (failed) {
51.91 + ret = ret.append("Failed execution of "); // NOI18N
51.92 + } else if (frameworkTaskResults != null && frameworkTaskResults.size() > 0) {
51.93 + ret = ret.append("Successful execution of "); // NOI18N
51.94 + } else { // complete success
51.95 + return;
51.96 + }
51.97 +
51.98 + ret = ret.append(actionName);
51.99 + ret = ret.append(": "); // NOI18N
51.100 + ret = ret.append(target);
51.101 +
51.102 +// if (partialSuccess) {
51.103 +// ret = ret.append(" (partial success)"); // NOI18N
51.104 +// }
51.105 +
51.106 + List<TaskResult> componentTaskResults =
51.107 + JBIMBeanTaskResultHandler.getTaskResultProblems(document, false);
51.108 +
51.109 + for (TaskResult frameworkTaskResult : frameworkTaskResults) {
51.110 + ret = ret.append("<br>"); // NOI18N
51.111 + ret = ret.append(frameworkTaskResult.toHtmlString());
51.112 + }
51.113 +
51.114 + ret = ret.append("<ul>"); // NOI18N
51.115 + for (TaskResult componentTaskResult : componentTaskResults) {
51.116 + ret = ret.append(componentTaskResult.toHtmlString());
51.117 + }
51.118 + ret = ret.append("</ul>"); // NOI18N
51.119 + }
51.120 +
51.121 + ret.append("</html>");
51.122 +
51.123 + int msgType = failed ? NotifyDescriptor.ERROR_MESSAGE : NotifyDescriptor.WARNING_MESSAGE;
51.124 + NotifyDescriptor d = new NotifyDescriptor.Message(ret.toString(), msgType);
51.125 + DialogDisplayer.getDefault().notify(d);
51.126 + }
51.127 +
51.128 + public static boolean isFrameworkTaskResultSuccessful(Document document) {
51.129 + XPathFactory xpathFactory = XPathFactory.newInstance();
51.130 + XPath xpath = xpathFactory.newXPath();
51.131 +
51.132 + try {
51.133 + String frameworkTaskResult = xpath.evaluate(
51.134 + "//frmwk-task-result/frmwk-task-result-details/task-result-details/task-result/text()", document); // NOI18N
51.135 + return frameworkTaskResult.equals("SUCCESS"); // NOI18N
51.136 + } catch (XPathExpressionException ex) {
51.137 + ex.printStackTrace();
51.138 + }
51.139 +
51.140 + return false;
51.141 + }
51.142 +
51.143 + public static List<TaskResult> getTaskResultProblems(Document document, boolean framework) {
51.144 + List<TaskResult> ret = new ArrayList<TaskResult>();
51.145 +
51.146 + ret.addAll(getTaskResultExceptions(document, framework));
51.147 + ret.addAll(getTaskResultErrors(document, framework));
51.148 + ret.addAll(getTaskResultWarnings(document, framework));
51.149 + ret.addAll(getTaskResultInfos(document, framework));
51.150 +
51.151 + return ret;
51.152 + }
51.153 +
51.154 + public static List<TaskResult> getTaskResultExceptions(Document document, boolean framework) {
51.155 + String expression = getMyXPathExpression("EXCEPTION", framework);
51.156 + return getMsgLocInfoOfType("ERROR", document, expression, framework);
51.157 + }
51.158 +
51.159 + public static List<TaskResult> getTaskResultErrors(Document document, boolean framework) {
51.160 + String expression = getMyXPathExpression("ERROR", framework);
51.161 + return getMsgLocInfoOfType("ERROR", document, expression, framework);
51.162 + }
51.163 +
51.164 + public static List<TaskResult> getTaskResultWarnings(Document document, boolean framework) {
51.165 + String expression = getMyXPathExpression("WARNING", framework);
51.166 + return getMsgLocInfoOfType("WARNING", document, expression, framework);
51.167 + }
51.168 +
51.169 + public static List<TaskResult> getTaskResultInfos(Document document, boolean framework) {
51.170 + String expression = getMyXPathExpression("INFO", framework);
51.171 + return getMsgLocInfoOfType("INFO", document, expression, framework);
51.172 + }
51.173 +
51.174 +
51.175 + private static String getMyXPathExpression(String messageType, boolean framework) {
51.176 + String ret = null;
51.177 +
51.178 + String taskResult = framework? "frmwk-task-result" : "component-task-result";
51.179 + if (messageType.equals("EXCEPTION")) {
51.180 + ret = "//" + taskResult + "/*/task-result-details/exception-info/msg-loc-info"; // NOI18N
51.181 + } else {
51.182 + ret = "//" + taskResult + "/*/task-result-details[message-type='" + messageType +"']/task-status-msg/msg-loc-info"; // NOI18N
51.183 + }
51.184 +
51.185 + return ret;
51.186 + }
51.187 +
51.188 +
51.189 + private static List<TaskResult> getMsgLocInfoOfType(String type,
51.190 + Document document, String expression, boolean framework) {
51.191 +
51.192 + List<TaskResult> ret = new ArrayList<TaskResult>();
51.193 +
51.194 + try {
51.195 + XPathFactory xpathFactory = XPathFactory.newInstance();
51.196 + XPath xpath = xpathFactory.newXPath();
51.197 +
51.198 + NodeList msgLocInfoNodeList = (NodeList) xpath.evaluate(expression,
51.199 + document, XPathConstants.NODESET);
51.200 +
51.201 + if (msgLocInfoNodeList != null) {
51.202 + int length = msgLocInfoNodeList.getLength();
51.203 + for (int i = 0; i < length; i++) {
51.204 + Node msgLocInfoNode = msgLocInfoNodeList.item(i);
51.205 + String locTokenValue = xpath.evaluate("loc-token/text()", msgLocInfoNode); // NOI18N
51.206 + String locMessageValue = xpath.evaluate("loc-message/text()", msgLocInfoNode); // NOI18N
51.207 +
51.208 + if (locTokenValue != null || locMessageValue != null) {
51.209 +
51.210 + if (framework) {
51.211 + ret.add(new TaskResult(type, locTokenValue, locMessageValue));
51.212 + } else {
51.213 + Node parent = msgLocInfoNode;
51.214 + while (!parent.getNodeName().equals("component-task-result")) {
51.215 + parent = parent.getParentNode();
51.216 + }
51.217 + String componentName =
51.218 + xpath.evaluate("component-name/text()", parent); // NOI18N
51.219 +
51.220 +
51.221 + ret.add(new ComponentTaskResult(type, locTokenValue,
51.222 + locMessageValue, componentName));
51.223 + }
51.224 + }
51.225 + }
51.226 + }
51.227 + } catch (XPathExpressionException e) {
51.228 + e.printStackTrace();
51.229 + }
51.230 +
51.231 + return ret;
51.232 + }
51.233 +
51.234 + private static Document getDocument(String xmlString) {
51.235 + try {
51.236 + DocumentBuilderFactory documentBuilderFactory =
51.237 + DocumentBuilderFactory.newInstance();
51.238 + DocumentBuilder documentBuilder =
51.239 + documentBuilderFactory.newDocumentBuilder();
51.240 + return documentBuilder.parse(new InputSource(new StringReader(xmlString)));
51.241 +
51.242 + } catch (Exception e) {
51.243 + System.out.println("Error parsing XML string: " + e); // NOI18N
51.244 + return null;
51.245 + }
51.246 + }
51.247 +
51.248 + public static Document getDocument(File xmlFile) {
51.249 + try {
51.250 + DocumentBuilderFactory documentBuilderFactory =
51.251 + DocumentBuilderFactory.newInstance();
51.252 + DocumentBuilder documentBuilder =
51.253 + documentBuilderFactory.newDocumentBuilder();
51.254 + return documentBuilder.parse(new InputSource(new FileReader(xmlFile)));
51.255 + } catch (Exception e) {
51.256 + System.out.println("Error parsing XML file: " + e); // NOI18N
51.257 + return null;
51.258 + }
51.259 + }
51.260 +
51.261 +}
51.262 +
51.263 +class TaskResult {
51.264 + private String messageType;
51.265 + private String locToken;
51.266 + private String locMessage;
51.267 +
51.268 + TaskResult(String messageType, String locToken, String locMessage) {
51.269 + this.messageType = messageType;
51.270 + this.locToken = locToken;
51.271 + this.locMessage = locMessage;
51.272 + }
51.273 +
51.274 + public String getMessageType() {
51.275 + return messageType;
51.276 + }
51.277 +
51.278 + public void setMessageType(String messageType) {
51.279 + this.messageType = messageType;
51.280 + }
51.281 +
51.282 + public String getLocToken() {
51.283 + return locToken;
51.284 + }
51.285 +
51.286 + public void setLocToken(String locToken) {
51.287 + this.locToken = locToken;
51.288 + }
51.289 +
51.290 + public String getLocMessage() {
51.291 + return locMessage;
51.292 + }
51.293 +
51.294 + public void setLocMessage(String locMessage) {
51.295 + this.locMessage = locMessage;
51.296 + }
51.297 +
51.298 + public String toString() {
51.299 + StringBuffer ret = new StringBuffer();
51.300 +
51.301 + ret = ret.append(getMessageType());
51.302 + ret = ret.append(": ("); // NOI18N
51.303 + ret = ret.append(getLocToken());
51.304 + ret = ret.append(") "); // NOI18N
51.305 + ret = ret.append(getLocMessage());
51.306 +
51.307 + return ret.toString();
51.308 + }
51.309 +
51.310 + public String toHtmlString() {
51.311 + StringBuffer ret = new StringBuffer();
51.312 +
51.313 + ret = ret.append("<b>"); // NOI18N
51.314 + ret = ret.append(getMessageType());
51.315 + ret = ret.append("</b>"); // NOI18N
51.316 + ret = ret.append(": ("); // NOI18N
51.317 + ret = ret.append(getLocToken());
51.318 + ret = ret.append(") "); // NOI18N
51.319 + ret = ret.append(getLocMessage());
51.320 +
51.321 + return ret.toString();
51.322 + }
51.323 +}
51.324 +
51.325 +class ComponentTaskResult extends TaskResult {
51.326 + private String componentName;
51.327 +
51.328 + ComponentTaskResult(String messageType, String locToken, String locMessage, String componentName) {
51.329 + super(messageType, locToken, locMessage);
51.330 + this.setComponentName(componentName);
51.331 + }
51.332 +
51.333 + public String getComponentName() {
51.334 + return componentName;
51.335 + }
51.336 +
51.337 + public void setComponentName(String componentName) {
51.338 + this.componentName = componentName;
51.339 + }
51.340 +
51.341 + public String toString() {
51.342 + StringBuffer ret = new StringBuffer();
51.343 +
51.344 + ret = ret.append(" * Component: "); // NOI18N
51.345 + ret = ret.append(getComponentName());
51.346 + ret = ret.append(JBIMBeanTaskResultHandler.LINE_SEPARATOR);
51.347 + ret = ret.append(" "); // NOI18N
51.348 + ret = ret.append(super.toString());
51.349 +
51.350 + return ret.toString();
51.351 + }
51.352 +
51.353 + public String toHtmlString() {
51.354 + StringBuffer ret = new StringBuffer();
51.355 +
51.356 + ret = ret.append("<li>"); // NOI18N
51.357 + ret = ret.append("Component: "); // NOI18N
51.358 + ret = ret.append(getComponentName());
51.359 + ret = ret.append("<br>"); // NOI18N
51.360 + ret = ret.append(" "); // NOI18N
51.361 + ret = ret.append(super.toHtmlString());
51.362 + ret = ret.append("</li>"); // NOI18N
51.363 +
51.364 + return ret.toString();
51.365 + }
51.366 +}
51.367 \ No newline at end of file
52.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
52.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/management/connectors/HTTPServerConnector.java Fri Oct 20 12:37:37 2006 +0000
52.3 @@ -0,0 +1,189 @@
52.4 +/*
52.5 + * The contents of this file are subject to the terms of the Common Development
52.6 + * and Distribution License (the License). You may not use this file except in
52.7 + * compliance with the License.
52.8 + *
52.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
52.10 + * or http://www.netbeans.org/cddl.txt.
52.11 +
52.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
52.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
52.14 + * If applicable, add the following below the CDDL Header, with the fields
52.15 + * enclosed by brackets [] replaced by your own identifying information:
52.16 + * "Portions Copyrighted [year] [name of copyright owner]"
52.17 + *
52.18 + * The Original Software is NetBeans. The Initial Developer of the Original
52.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
52.20 + * Microsystems, Inc. All Rights Reserved.
52.21 + */
52.22 +
52.23 +
52.24 +/*
52.25 + * Created on Dec 22, 2004
52.26 + *
52.27 + * TODO To change the template for this generated file go to
52.28 + * Window - Preferences - Java - Code Style - Code Templates
52.29 + */
52.30 +package org.netbeans.modules.sun.manager.jbi.management.connectors;
52.31 +
52.32 +import java.io.Serializable;
52.33 +
52.34 +import java.util.HashMap;
52.35 +import java.util.Map;
52.36 +
52.37 +import javax.management.MBeanServerConnection;
52.38 +import javax.management.remote.JMXConnector;
52.39 +import javax.management.remote.JMXConnectorFactory;
52.40 +import javax.management.remote.JMXServiceURL;
52.41 +
52.42 +
52.43 +/**
52.44 + * DOCUMENT ME!
52.45 + *
52.46 + * @author Graj TODO To change the template for this generated type comment go to Window -
52.47 + * Preferences - Java - Code Style - Code Templates
52.48 + */
52.49 +public class HTTPServerConnector extends ServerConnector implements Serializable {
52.50 + /**
52.51 + * DOCUMENT ME!
52.52 + */
52.53 + static final String PROTOCOL_CLASS = "com.sun.enterprise.admin.jmx.remote.protocol"; // NOI18N
52.54 +
52.55 + /**
52.56 + * DOCUMENT ME!
52.57 + */
52.58 + static final String HTTP_AUTH_PROPERTY_NAME = "com.sun.enterprise.as.http.auth"; // NOI18N
52.59 +
52.60 + /**
52.61 + * DOCUMENT ME!
52.62 + */
52.63 + static final String DEFAULT_HTTP_AUTH_SCHEME = "BASIC"; // NOI18N
52.64 +
52.65 + /**
52.66 + * DOCUMENT ME!
52.67 + */
52.68 + static final String ADMIN_USER_ENV_PROPERTY_NAME = "USER"; // NOI18N
52.69 +
52.70 + /**
52.71 + * DOCUMENT ME!
52.72 + */
52.73 + static final String ADMIN_PASSWORD_ENV_PROPERTY_NAME = "PASSWORD"; // NOI18N
52.74 +
52.75 + /**
52.76 + * DOCUMENT ME!
52.77 + */
52.78 + static final String RTS_HTTP_CONNECTOR = "s1ashttp"; // NOI18N
52.79 +
52.80 + /**
52.81 + * DOCUMENT ME!
52.82 + */
52.83 + transient MBeanServerConnection connection;
52.84 +
52.85 + private ClassLoader jbiClassLoader;
52.86 +
52.87 + /**
52.88 + * DOCUMENT ME!
52.89 + *
52.90 + * @param hostNameParam
52.91 + * @param portParam
52.92 + * @param userNameParam
52.93 + * @param passwordParam
52.94 + */
52.95 + public HTTPServerConnector(
52.96 + String hostNameParam, String portParam, String userNameParam, String passwordParam,
52.97 + ClassLoader jbiClassLoader
52.98 + ) {
52.99 + super(hostNameParam, portParam, userNameParam, passwordParam);
52.100 +
52.101 + this.jbiClassLoader = jbiClassLoader;
52.102 +
52.103 + try {
52.104 + initialize();
52.105 + } catch (Exception e) {
52.106 + e.printStackTrace();
52.107 + }
52.108 + }
52.109 +
52.110 + /**
52.111 + * DOCUMENT ME!
52.112 + *
52.113 + * @param hostNameParam
52.114 + * @param portParam
52.115 + * @param userNameParam
52.116 + * @param passwordParam
52.117 + */
52.118 + public void setParameters(
52.119 + String hostNameParam, String portParam, String userNameParam, String passwordParam
52.120 + ) {
52.121 + this.hostName = hostNameParam;
52.122 + this.port = portParam;
52.123 + this.userName = userNameParam;
52.124 + this.password = passwordParam;
52.125 +
52.126 + try {
52.127 + initialize();
52.128 + } catch (Exception e) {
52.129 + e.printStackTrace();
52.130 + }
52.131 + }
52.132 +
52.133 + /**
52.134 + * DOCUMENT ME!
52.135 + *
52.136 + * @return Returns the connection.
52.137 + */
52.138 + public MBeanServerConnection getConnection() {
52.139 + return this.connection;
52.140 + }
52.141 +
52.142 + /**
52.143 + * This method returns the MBeanServerConnection to used to invoke the MBean methods via HTPP
52.144 + * connector.
52.145 + *
52.146 + * @throws Exception DOCUMENT ME!
52.147 + */
52.148 + public void initialize() throws Exception {
52.149 + boolean result = true;
52.150 + final Map<String, Object> environment = new HashMap<String, Object>();
52.151 + environment.put(
52.152 + JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, HTTPServerConnector.PROTOCOL_CLASS
52.153 + );
52.154 + environment.put(
52.155 + HTTPServerConnector.HTTP_AUTH_PROPERTY_NAME,
52.156 + HTTPServerConnector.DEFAULT_HTTP_AUTH_SCHEME
52.157 + );
52.158 + environment.put(HTTPServerConnector.ADMIN_USER_ENV_PROPERTY_NAME, this.getUserName());
52.159 + environment.put(HTTPServerConnector.ADMIN_PASSWORD_ENV_PROPERTY_NAME, this.getPassword());
52.160 +
52.161 + environment.put(JMXConnectorFactory.PROTOCOL_PROVIDER_CLASS_LOADER, jbiClassLoader);
52.162 +
52.163 + try {
52.164 + int portValue = new Integer(this.getPort()).intValue();
52.165 + JMXServiceURL serviceURL = new JMXServiceURL(
52.166 + HTTPServerConnector.RTS_HTTP_CONNECTOR, this.getHostName(), portValue
52.167 + );
52.168 + JMXConnector connector = JMXConnectorFactory.connect(serviceURL, environment);
52.169 + this.connection = connector.getMBeanServerConnection();
52.170 + } catch (Exception exception) {
52.171 + throw exception;
52.172 + }
52.173 + }
52.174 +
52.175 + /**
52.176 + * DOCUMENT ME!
52.177 + *
52.178 + * @param args DOCUMENT ME!
52.179 + */
52.180 + public static void main(String[] args) {
52.181 + HTTPServerConnector connector = new HTTPServerConnector(
52.182 + "GRajGX270.stc.com", "4848", "admin", "adminadmin", null // NOI18N
52.183 + );
52.184 +
52.185 + if (connector.getConnection() != null) {
52.186 + System.out.println("Connection Retrieved." + connector.toString()); // NOI18N
52.187 + connector.printOut();
52.188 + } else {
52.189 + System.out.println("Connection Failed"); // NOI18N
52.190 + }
52.191 + }
52.192 +}
53.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
53.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/management/connectors/ServerConnector.java Fri Oct 20 12:37:37 2006 +0000
53.3 @@ -0,0 +1,164 @@
53.4 +/*
53.5 + * The contents of this file are subject to the terms of the Common Development
53.6 + * and Distribution License (the License). You may not use this file except in
53.7 + * compliance with the License.
53.8 + *
53.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
53.10 + * or http://www.netbeans.org/cddl.txt.
53.11 +
53.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
53.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
53.14 + * If applicable, add the following below the CDDL Header, with the fields
53.15 + * enclosed by brackets [] replaced by your own identifying information:
53.16 + * "Portions Copyrighted [year] [name of copyright owner]"
53.17 + *
53.18 + * The Original Software is NetBeans. The Initial Developer of the Original
53.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
53.20 + * Microsystems, Inc. All Rights Reserved.
53.21 + */
53.22 +
53.23 +
53.24 +/*
53.25 + * Created on Dec 22, 2004
53.26 + *
53.27 + * TODO To change the template for this generated file go to
53.28 + * Window - Preferences - Java - Code Style - Code Templates
53.29 + */
53.30 +package org.netbeans.modules.sun.manager.jbi.management.connectors;
53.31 +
53.32 +import java.io.Serializable;
53.33 +
53.34 +
53.35 +/**
53.36 + * DOCUMENT ME!
53.37 + *
53.38 + * @author Graj TODO To change the template for this generated type comment go to Window -
53.39 + * Preferences - Java - Code Style - Code Templates
53.40 + */
53.41 +public class ServerConnector implements Serializable {
53.42 + /**
53.43 + * DOCUMENT ME!
53.44 + */
53.45 + String hostName;
53.46 +
53.47 + /**
53.48 + * DOCUMENT ME!
53.49 + */
53.50 + String port;
53.51 +
53.52 + /**
53.53 + * DOCUMENT ME!
53.54 + */
53.55 + String userName;
53.56 +
53.57 + /**
53.58 + * DOCUMENT ME!
53.59 + */
53.60 + String password;
53.61 +
53.62 + /**
53.63 + *
53.64 + */
53.65 + public ServerConnector(
53.66 + String hostNameParam, String portParam, String userNameParam, String passwordParam
53.67 + ) {
53.68 + this.hostName = hostNameParam;
53.69 + this.port = portParam;
53.70 + this.userName = userNameParam;
53.71 + this.password = passwordParam;
53.72 + }
53.73 +
53.74 + /**
53.75 + * DOCUMENT ME!
53.76 + *
53.77 + * @param password The password to set.
53.78 + */
53.79 + public void setPassword(String password) {
53.80 + this.password = password;
53.81 + }
53.82 +
53.83 + /**
53.84 + * DOCUMENT ME!
53.85 + *
53.86 + * @param userName The userName to set.
53.87 + */
53.88 + public void setUserName(String userName) {
53.89 + this.userName = userName;
53.90 + }
53.91 +
53.92 + /**
53.93 + * DOCUMENT ME!
53.94 + *
53.95 + * @return Returns the password.
53.96 + */
53.97 + public String getPassword() {
53.98 + return this.password;
53.99 + }
53.100 +
53.101 + /**
53.102 + * DOCUMENT ME!
53.103 + *
53.104 + * @return Returns the userName.
53.105 + */
53.106 + public String getUserName() {
53.107 + return this.userName;
53.108 + }
53.109 +
53.110 + /**
53.111 + * DOCUMENT ME!
53.112 + *
53.113 + * @return Returns the hostName.
53.114 + */
53.115 + public String getHostName() {
53.116 + return this.hostName;
53.117 + }
53.118 +
53.119 + /**
53.120 + * DOCUMENT ME!
53.121 + *
53.122 + * @param hostName The hostName to set.
53.123 + */
53.124 + public void setHostName(String hostName) {
53.125 + this.hostName = hostName;
53.126 + }
53.127 +
53.128 + /**
53.129 + * DOCUMENT ME!
53.130 + *
53.131 + * @return Returns the port.
53.132 + */
53.133 + public String getPort() {
53.134 + return this.port;
53.135 + }
53.136 +
53.137 + /**
53.138 + * DOCUMENT ME!
53.139 + *
53.140 + * @param port The port to set.
53.141 + */
53.142 + public void setPort(String port) {
53.143 + this.port = port;
53.144 + }
53.145 +
53.146 + /**
53.147 + * DOCUMENT ME!
53.148 + */
53.149 + public void printOut() {
53.150 + System.out.println("/////////////////////////////////"); // NOI18N
53.151 + System.out.println("// -- Server Connector -- //"); // NOI18N
53.152 + System.out.println("/////////////////////////////////"); // NOI18N
53.153 + System.out.println("// HostName is: " + hostName); // NOI18N
53.154 + System.out.println("// Port is: " + port); // NOI18N
53.155 + System.out.println("// UserName is: " + userName); // NOI18N
53.156 + System.out.println("// Password is: " + password); // NOI18N
53.157 + System.out.println("/////////////////////////////////"); // NOI18N
53.158 + }
53.159 +
53.160 + /**
53.161 + * DOCUMENT ME!
53.162 + *
53.163 + * @param args DOCUMENT ME!
53.164 + */
53.165 + public static void main(String[] args) {
53.166 + }
53.167 +}
54.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
54.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/management/model/JBIComponentDocument.java Fri Oct 20 12:37:37 2006 +0000
54.3 @@ -0,0 +1,84 @@
54.4 +/*
54.5 + * The contents of this file are subject to the terms of the Common Development
54.6 + * and Distribution License (the License). You may not use this file except in
54.7 + * compliance with the License.
54.8 + *
54.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
54.10 + * or http://www.netbeans.org/cddl.txt.
54.11 +
54.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
54.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
54.14 + * If applicable, add the following below the CDDL Header, with the fields
54.15 + * enclosed by brackets [] replaced by your own identifying information:
54.16 + * "Portions Copyrighted [year] [name of copyright owner]"
54.17 + *
54.18 + * The Original Software is NetBeans. The Initial Developer of the Original
54.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
54.20 + * Microsystems, Inc. All Rights Reserved.
54.21 + */
54.22 +
54.23 +package org.netbeans.modules.sun.manager.jbi.management.model;
54.24 +
54.25 +import java.io.Serializable;
54.26 +import java.util.ArrayList;
54.27 +import java.util.Iterator;
54.28 +import java.util.List;
54.29 +
54.30 +
54.31 +/**
54.32 + * Retrieves the list of JBI Components like JBI Service Engines,
54.33 + * JBI Binding Components, and JBI Shared Libraries installed
54.34 + * on the JBI Container
54.35 + *
54.36 + * @author Graj
54.37 + */
54.38 +public class JBIComponentDocument implements Serializable {
54.39 +
54.40 + public static final String COMP_INFO_LIST_NODE_NAME = "component-info-list"; // NOI18N
54.41 + public static final String COMP_INFO_NODE_NAME = "component-info"; // NOI18N
54.42 +// public static final String ID_NODE_NAME = "id";
54.43 + public static final String NAME_NODE_NAME = "name"; // NOI18N
54.44 + public static final String TYPE_NODE_NAME = "type"; // NOI18N
54.45 + public static final String STATUS_NODE_NAME = "state"; // NOI18N
54.46 + public static final String DESCRIPTION_NODE_NAME = "description"; // NOI18N
54.47 + public static final String VERSION_NODE_NAME = "version"; // NOI18N
54.48 + public static final String NAMESPACE_NODE_NAME = "xmlns"; // NOI18N
54.49 +
54.50 + List<JBIComponentStatus> jbiComponentList = new ArrayList<JBIComponentStatus>();
54.51 +
54.52 +
54.53 + /**
54.54 + *
54.55 + */
54.56 + public JBIComponentDocument() {
54.57 + super();
54.58 + // TODO Auto-generated constructor stub
54.59 + }
54.60 +
54.61 +
54.62 +
54.63 + /**
54.64 + * @return Returns the jbiComponentList.
54.65 + */
54.66 + public List<JBIComponentStatus> getJbiComponentList() {
54.67 + return this.jbiComponentList;
54.68 + }
54.69 + /**
54.70 + * @param jbiComponentList The jbiComponentList to set.
54.71 + */
54.72 + public void setJbiComponentList(List<JBIComponentStatus> jbiComponentList) {
54.73 + this.jbiComponentList = jbiComponentList;
54.74 + }
54.75 +
54.76 + public void dump() {
54.77 + Iterator<JBIComponentStatus> iterator = this.jbiComponentList.iterator();
54.78 + JBIComponentStatus component = null;
54.79 + while((iterator != null) && (iterator.hasNext() == true)) {
54.80 + component = iterator.next();
54.81 + component.dump();
54.82 + }
54.83 + }
54.84 +
54.85 + public static void main(String[] args) {
54.86 + }
54.87 +}
55.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
55.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/management/model/JBIComponentStatus.java Fri Oct 20 12:37:37 2006 +0000
55.3 @@ -0,0 +1,168 @@
55.4 +/*
55.5 + * The contents of this file are subject to the terms of the Common Development
55.6 + * and Distribution License (the License). You may not use this file except in
55.7 + * compliance with the License.
55.8 + *
55.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
55.10 + * or http://www.netbeans.org/cddl.txt.
55.11 +
55.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
55.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
55.14 + * If applicable, add the following below the CDDL Header, with the fields
55.15 + * enclosed by brackets [] replaced by your own identifying information:
55.16 + * "Portions Copyrighted [year] [name of copyright owner]"
55.17 + *
55.18 + * The Original Software is NetBeans. The Initial Developer of the Original
55.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
55.20 + * Microsystems, Inc. All Rights Reserved.
55.21 + */
55.22 +
55.23 +package org.netbeans.modules.sun.manager.jbi.management.model;
55.24 +import java.io.Serializable;
55.25 +
55.26 +/**
55.27 + * Retrieves the status of JBI components installed on the
55.28 + * JBI Container on the Server
55.29 + *
55.30 + * @author Graj
55.31 + */
55.32 +public class JBIComponentStatus implements Serializable {
55.33 +
55.34 + /** Deployment Type */
55.35 + public static final String DEPLOYMENT_TYPE = "service-assembly"; // NOI18N
55.36 +// public static final String DEPLOYMENT_TYPE = "Deployment";
55.37 + /** unknown type */
55.38 + public static final String UNKNOWN_TYPE = "unknown"; // NOI18N
55.39 + /** Binding type */
55.40 + public static final String BINDING_TYPE = "binding-component"; // NOI18N
55.41 +// public static final String BINDING_TYPE = "Binding";
55.42 + /** Engine Type */
55.43 + public static final String ENGINE_TYPE = "service-engine"; // NOI18N
55.44 +// public static final String ENGINE_TYPE = "Engine";
55.45 + /** Namespace Type */
55.46 + public static final String NAMESPACE_TYPE = "shared-library"; // NOI18N
55.47 +// public static final String NAMESPACE_TYPE = "SharedLibrary";
55.48 +
55.49 + /** state Loaded state. */
55.50 + public static final String UNKNOWN_STATE = "Unknown"; // NOI18N
55.51 + /** state loaded */
55.52 + public static final String LOADED_STATE = "Loaded"; // NOI18N
55.53 + /** Installed state */
55.54 +// public static final String INSTALLED_STATE = "Installed";
55.55 + public static final String INSTALLED_STATE = "Shutdown"; // NOI18N
55.56 + /** Stopped state */
55.57 + public static final String STOPPED_STATE = "Stopped"; // NOI18N
55.58 + /** Started state */
55.59 + public static final String STARTED_STATE = "Started"; // NOI18N
55.60 +
55.61 + String componentId;
55.62 + String state;
55.63 + String name;
55.64 + String description;
55.65 + String type;
55.66 +
55.67 + /**
55.68 + *
55.69 + */
55.70 + public JBIComponentStatus() {
55.71 + super();
55.72 + }
55.73 +
55.74 +
55.75 +
55.76 + /**
55.77 + * @param componentId
55.78 + * @param state
55.79 + * @param name
55.80 + * @param description
55.81 + * @param type
55.82 + */
55.83 + public JBIComponentStatus(String componentId, String name, String description, String type, String state) {
55.84 + super();
55.85 + this.componentId = componentId;
55.86 + this.name = name;
55.87 + this.description = description;
55.88 + this.type = type;
55.89 + this.state = state;
55.90 + }
55.91 + /**
55.92 + * @return Returns the componentId.
55.93 + */
55.94 + public String getComponentId() {
55.95 + return this.componentId;
55.96 + }
55.97 + /**
55.98 + * @param componentId The componentId to set.
55.99 + */
55.100 + public void setComponentId(String componentId) {
55.101 + this.componentId = componentId;
55.102 + }
55.103 + /**
55.104 + * @return Returns the description.
55.105 + */
55.106 + public String getDescription() {
55.107 + return this.description;
55.108 + }
55.109 + /**
55.110 + * @param description The description to set.
55.111 + */
55.112 + public void setDescription(String description) {
55.113 + if((description != null) && (description.length() > 0)) {
55.114 + this.description = description;
55.115 + }
55.116 + }
55.117 + /**
55.118 + * @return Returns the name.
55.119 + */
55.120 + public String getName() {
55.121 + return this.name;
55.122 + }
55.123 + /**
55.124 + * @param name The name to set.
55.125 + */
55.126 + public void setName(String name) {
55.127 + this.name = name;
55.128 + }
55.129 + /**
55.130 + * @return Returns the state.
55.131 + */
55.132 + public String getState() {
55.133 + return this.state;
55.134 + }
55.135 + /**
55.136 + * @param state The state to set.
55.137 + */
55.138 + public void setState(String status) {
55.139 + this.state = status;
55.140 + }
55.141 +
55.142 +
55.143 + /**
55.144 + * @return Returns the type.
55.145 + */
55.146 + public String getType() {
55.147 + return this.type;
55.148 + }
55.149 + /**
55.150 + * @param type The type to set.
55.151 + */
55.152 + public void setType(String type) {
55.153 + this.type = type;
55.154 + }
55.155 +
55.156 + public void dump() {
55.157 + System.out.println("/////////////////////////////////////////////////"); // NOI18N
55.158 + System.out.println("// -- JBI Component -- //"); // NOI18N
55.159 + System.out.println("/////////////////////////////////////////////////"); // NOI18N
55.160 + //System.out.println("// componentId is: "+ this.componentId);
55.161 + System.out.println("// name is: "+ this.name); // NOI18N
55.162 + System.out.println("// description is: "+ this.description); // NOI18N
55.163 + System.out.println("// type is: "+ this.type); // NOI18N
55.164 + System.out.println("// state is: "+ this.state); // NOI18N
55.165 + System.out.println("/////////////////////////////////////////////////"); // NOI18N
55.166 + }
55.167 +
55.168 + public static void main(String[] args) {
55.169 + }
55.170 +}
55.171 +
56.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
56.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/AppserverJBIMgmtContainerNode.java Fri Oct 20 12:37:37 2006 +0000
56.3 @@ -0,0 +1,126 @@
56.4 +/*
56.5 + * The contents of this file are subject to the terms of the Common Development
56.6 + * and Distribution License (the License). You may not use this file except in
56.7 + * compliance with the License.
56.8 + *
56.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
56.10 + * or http://www.netbeans.org/cddl.txt.
56.11 +
56.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
56.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
56.14 + * If applicable, add the following below the CDDL Header, with the fields
56.15 + * enclosed by brackets [] replaced by your own identifying information:
56.16 + * "Portions Copyrighted [year] [name of copyright owner]"
56.17 + *
56.18 + * The Original Software is NetBeans. The Initial Developer of the Original
56.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
56.20 + * Microsystems, Inc. All Rights Reserved.
56.21 + */
56.22 +
56.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
56.24 +
56.25 +import java.util.Collections;
56.26 +import java.util.logging.Level;
56.27 +
56.28 +import javax.swing.Action;
56.29 +
56.30 +import org.netbeans.modules.j2ee.sun.bridge.apis.RefreshAction;
56.31 +import org.netbeans.modules.j2ee.sun.bridge.apis.RefreshCookie;
56.32 +import org.netbeans.modules.sun.manager.jbi.util.AppserverJBIMgmtController;
56.33 +import org.netbeans.modules.sun.manager.jbi.util.JBIContainerChildFactory;
56.34 +import org.openide.nodes.Children;
56.35 +import org.openide.nodes.Node;
56.36 +import org.openide.util.actions.SystemAction;
56.37 +
56.38 +
56.39 +/**
56.40 + * Abstract super class for all container node in JBI Manager.
56.41 + *
56.42 + * @author jqian
56.43 + */
56.44 +public abstract class AppserverJBIMgmtContainerNode extends AppserverJBIMgmtNode
56.45 + implements RefreshCookie {
56.46 +
56.47 + /**
56.48 + *
56.49 + */
56.50 + public AppserverJBIMgmtContainerNode(
56.51 + final AppserverJBIMgmtController controller, final String type) {
56.52 + super(controller, getChildren(controller, type), type);
56.53 + }
56.54 +
56.55 +
56.56 + /**
56.57 + * Return the actions associated with the menu drop down seen when
56.58 + * a user right-clicks on an Applications node in the plugin.
56.59 + *
56.60 + * @param boolean true/false
56.61 + * @return An array of Action objects.
56.62 + */
56.63 + public Action[] getActions(boolean flag) {
56.64 + return new SystemAction[] {
56.65 + SystemAction.get(RefreshAction.class)
56.66 + };
56.67 + }
56.68 +
56.69 + /**
56.70 + *
56.71 + */
56.72 + static Children getChildren(final AppserverJBIMgmtController controller,
56.73 + final String type){
56.74 + return new JBIContainerChildren(controller, type);
56.75 + }
56.76 +
56.77 +
56.78 + /**
56.79 + *
56.80 + *
56.81 + */
56.82 + public void refresh(){
56.83 + setChildren(new JBIContainerChildren(getAppserverJBIMgmtController(), getNodeType()));
56.84 + JBIContainerChildren ch = (JBIContainerChildren)getChildren();
56.85 + ch.updateKeys();
56.86 + }
56.87 +
56.88 +
56.89 + /**
56.90 + *
56.91 + *
56.92 + */
56.93 + public static class JBIContainerChildren extends Children.Keys {
56.94 + String type;
56.95 + JBIContainerChildFactory cfactory;
56.96 + public JBIContainerChildren(AppserverJBIMgmtController controller, String type) {
56.97 + if(controller == null) {
56.98 + getLogger().log(Level.FINE, "Controller for child factory " + "is null"); // NOI18N
56.99 + getLogger().log(Level.FINE, "Type: " + type); // NOI18N
56.100 + }
56.101 + this.type = type;
56.102 + this.cfactory = new JBIContainerChildFactory(controller);
56.103 + }
56.104 + protected void addNotify() {
56.105 + try {
56.106 + setKeys(this.cfactory.getChildrenObject(getNode(), this.type));
56.107 + } catch (RuntimeException e) {
56.108 + getLogger().log(Level.FINE, e.getMessage(), e);
56.109 + }
56.110 + }
56.111 + protected void removeNotify() {
56.112 + setKeys(Collections.EMPTY_SET);
56.113 + }
56.114 + public void updateKeys() {
56.115 + refresh();
56.116 + }
56.117 + protected org.openide.nodes.Node[] createNodes(Object obj) {
56.118 + try {
56.119 + return new Node[] { (Node)obj };
56.120 + } catch(RuntimeException rex) {
56.121 + getLogger().log(Level.FINE, rex.getMessage(), rex);
56.122 + return new Node[] {};
56.123 + } catch(Exception e) {
56.124 + getLogger().log(Level.FINE, e.getMessage(), e);
56.125 + return new Node[] {};
56.126 + }
56.127 + }
56.128 + }
56.129 +}
57.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
57.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/AppserverJBIMgmtLeafNode.java Fri Oct 20 12:37:37 2006 +0000
57.3 @@ -0,0 +1,66 @@
57.4 +/*
57.5 + * The contents of this file are subject to the terms of the Common Development
57.6 + * and Distribution License (the License). You may not use this file except in
57.7 + * compliance with the License.
57.8 + *
57.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
57.10 + * or http://www.netbeans.org/cddl.txt.
57.11 +
57.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
57.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
57.14 + * If applicable, add the following below the CDDL Header, with the fields
57.15 + * enclosed by brackets [] replaced by your own identifying information:
57.16 + * "Portions Copyrighted [year] [name of copyright owner]"
57.17 + *
57.18 + * The Original Software is NetBeans. The Initial Developer of the Original
57.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
57.20 + * Microsystems, Inc. All Rights Reserved.
57.21 + */
57.22 +
57.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
57.24 +
57.25 +import javax.swing.Action;
57.26 +
57.27 +import org.netbeans.modules.sun.manager.jbi.util.AppserverJBIMgmtController;
57.28 +import org.openide.actions.PropertiesAction;
57.29 +import org.openide.nodes.Children;
57.30 +import org.openide.util.actions.SystemAction;
57.31 +
57.32 +/**
57.33 + *
57.34 + * @author jqian
57.35 + */
57.36 +public abstract class AppserverJBIMgmtLeafNode extends AppserverJBIMgmtNode {
57.37 +
57.38 + /**
57.39 + * Abstract constructor for an AppserverLeafNode called by subclass.
57.40 + *
57.41 + * @param nodeType The type of leaf node to construct (e.g. JVM, etc.)
57.42 + */
57.43 + public AppserverJBIMgmtLeafNode(final AppserverJBIMgmtController controller,
57.44 + final String nodeType) {
57.45 + super(controller, Children.LEAF, nodeType);
57.46 + }
57.47 +
57.48 +
57.49 + /**
57.50 + * Return the actions associated with the menu drop down seen when
57.51 + * a user right-clicks on a node in the plugin.
57.52 + *
57.53 + * @param boolean true/false
57.54 + * @return An array of Action objects.
57.55 + */
57.56 + public Action[] getActions(boolean flag) {
57.57 + return new SystemAction[] {
57.58 + SystemAction.get(PropertiesAction.class)
57.59 + };
57.60 + }
57.61 +
57.62 + /**
57.63 + * Return the default action for the node
57.64 + * a user double-clicks on a node in the plugin.
57.65 + */
57.66 + public Action getPreferredAction(){
57.67 + return SystemAction.get(PropertiesAction.class);
57.68 + }
57.69 +}
58.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
58.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/AppserverJBIMgmtNode.java Fri Oct 20 12:37:37 2006 +0000
58.3 @@ -0,0 +1,159 @@
58.4 +/*
58.5 + * The contents of this file are subject to the terms of the Common Development
58.6 + * and Distribution License (the License). You may not use this file except in
58.7 + * compliance with the License.
58.8 + *
58.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
58.10 + * or http://www.netbeans.org/cddl.txt.
58.11 +
58.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
58.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
58.14 + * If applicable, add the following below the CDDL Header, with the fields
58.15 + * enclosed by brackets [] replaced by your own identifying information:
58.16 + * "Portions Copyrighted [year] [name of copyright owner]"
58.17 + *
58.18 + * The Original Software is NetBeans. The Initial Developer of the Original
58.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
58.20 + * Microsystems, Inc. All Rights Reserved.
58.21 + */
58.22 +
58.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
58.24 +
58.25 +import java.util.Iterator;
58.26 +import java.util.Map;
58.27 +import java.util.logging.Level;
58.28 +
58.29 +import javax.management.Attribute;
58.30 +import javax.management.MBeanAttributeInfo;
58.31 +
58.32 +import org.netbeans.modules.j2ee.sun.bridge.apis.AppserverMgmtNode;
58.33 +import org.netbeans.modules.sun.manager.jbi.util.AppserverJBIMgmtController;
58.34 +import org.netbeans.modules.sun.manager.jbi.util.JBIPropertySupportFactory;
58.35 +import org.openide.nodes.Children;
58.36 +import org.openide.nodes.PropertySupport;
58.37 +import org.openide.nodes.Sheet;
58.38 +import org.openide.util.NbBundle;
58.39 +
58.40 +/**
58.41 + * Abstract super class for all nodes in JBI manager.
58.42 + *
58.43 + * @author jqian
58.44 + */
58.45 +public abstract class AppserverJBIMgmtNode extends AppserverMgmtNode {
58.46 +
58.47 + private AppserverJBIMgmtController appsrvrJBIMgmtController;
58.48 +
58.49 + private JBIPropertySupportFactory propSupportFactory =
58.50 + JBIPropertySupportFactory.getInstance();
58.51 +
58.52 +
58.53 + /**
58.54 + *
58.55 + *
58.56 + */
58.57 + public AppserverJBIMgmtNode(final AppserverJBIMgmtController controller,
58.58 + final Children children, final String nodeType) {
58.59 + super(children, nodeType);
58.60 + appsrvrJBIMgmtController = controller;
58.61 + }
58.62 +
58.63 +
58.64 + /**
58.65 + *
58.66 + *
58.67 + */
58.68 + public AppserverJBIMgmtController getAppserverJBIMgmtController() {
58.69 + try {
58.70 + if(appsrvrJBIMgmtController == null) {
58.71 + getLogger().log(Level.FINE, "AppserverJBIMgmtController is " + "null for [" + getNodeType() + "]"); // NOI18N
58.72 + }
58.73 + } catch(Exception e) {
58.74 + getLogger().log(Level.FINE, e.getMessage(), e);
58.75 + }
58.76 + return appsrvrJBIMgmtController;
58.77 + }
58.78 +
58.79 + /**
58.80 + *
58.81 + */
58.82 + protected String getNodeDisplayName() {
58.83 + return NbBundle.getMessage(AppserverJBIMgmtNode.class, getNodeType());
58.84 + }
58.85 +
58.86 +
58.87 + /**
58.88 + *
58.89 + */
58.90 + protected String getNodeShortDescription() {
58.91 + return NbBundle.getMessage(AppserverJBIMgmtNode.class, getNodeType() + "_SHORT_DESC"); // NOI18N
58.92 + }
58.93 +
58.94 + /**
58.95 + * Creates a properties Sheet for viewing when a user chooses the option
58.96 + * from the right-click menu.
58.97 + *
58.98 + * @returns the Sheet to display when Properties is chosen by the user.
58.99 + */
58.100 + protected Sheet createSheet() {
58.101 + Sheet sheet = Sheet.createDefault();
58.102 +
58.103 + ClassLoader origClassLoader=Thread.currentThread().getContextClassLoader();
58.104 +
58.105 + try {
58.106 + Thread.currentThread().setContextClassLoader(
58.107 + this.getClass().getClassLoader());
58.108 +
58.109 + Sheet.Set props = sheet.get(Sheet.PROPERTIES);
58.110 + props.put(createPropertySupportArray(getSheetProperties()));
58.111 + return sheet;
58.112 + } catch(RuntimeException rex) {
58.113 + return sheet;
58.114 + } finally {
58.115 + Thread.currentThread().setContextClassLoader(origClassLoader);
58.116 + }
58.117 + }
58.118 +
58.119 +
58.120 + /**
58.121 + * Creates a PropertySupport array from a map of component properties.
58.122 + *
58.123 + * @param properties The properties of the component.
58.124 + * @return An array of PropertySupport objects.
58.125 + */
58.126 + private PropertySupport[] createPropertySupportArray(final Map attrMap) {
58.127 + PropertySupport[] supports = new PropertySupport[attrMap.size()];
58.128 + int i = 0;
58.129 +
58.130 + for(Iterator itr = attrMap.keySet().iterator(); itr.hasNext(); ) {
58.131 + Attribute attr = (Attribute) itr.next();
58.132 + MBeanAttributeInfo info = (MBeanAttributeInfo) attrMap.get(attr);
58.133 + supports[i] =
58.134 + propSupportFactory.getPropertySupport(this, attr, info);
58.135 + i++;
58.136 + }
58.137 + return supports;
58.138 + }
58.139 +
58.140 +
58.141 + /**
58.142 + * Returns all the properties of the leaf node to disply in the properties
58.143 + * window (or Sheet). This must be overriden in order for the Sheet to be
58.144 + * processed.
58.145 + *
58.146 + * @returns a java.util.Map of all properties to be accessed from the Sheet.
58.147 + */
58.148 + protected abstract Map getSheetProperties();
58.149 +
58.150 + /**
58.151 + * Sets the property as an attribute to the underlying AMX mbeans. It
58.152 + * usually will delegate to the controller object which is responsible for
58.153 + * finding the correct AMX mbean objectname in order to execute a
58.154 + * JMX setAttribute.
58.155 + *
58.156 + * @param attrName The name of the property to be set.
58.157 + * @param value The value retrieved from the property sheet to be set in the
58.158 + * backend.
58.159 + * @returns the updated Attribute accessed from the Sheet.
58.160 + */
58.161 + public abstract Attribute setSheetProperty(String attrName, Object value);
58.162 +}
59.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
59.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/Bundle.properties Fri Oct 20 12:37:37 2006 +0000
59.3 @@ -0,0 +1,74 @@
59.4 +#
59.5 +# The contents of this file are subject to the terms of the Common Development
59.6 +# and Distribution License (the License). You may not use this file except in
59.7 +# compliance with the License.
59.8 +#
59.9 +# You can obtain a copy of the License at http://www.netbeans.org/cddl.html
59.10 +# or http://www.netbeans.org/cddl.txt.
59.11 +
59.12 +# When distributing Covered Code, include this CDDL Header Notice in each file
59.13 +# and include the License file at http://www.netbeans.org/cddl.txt.
59.14 +# If applicable, add the following below the CDDL Header, with the fields
59.15 +# enclosed by brackets [] replaced by your own identifying information:
59.16 +# "Portions Copyrighted [year] [name of copyright owner]"
59.17 +#
59.18 +# The Original Software is NetBeans. The Initial Developer of the Original
59.19 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
59.20 +# Microsystems, Inc. All Rights Reserved.
59.21 +#
59.22 +# Node Names
59.23 +JBI=JBI
59.24 +SERVICE_ENGINES=Service Engines
59.25 +SERVICE_ENGINE=Service Engine
59.26 +BINDING_COMPONENTS=Binding Components
59.27 +BINDING_COMPONENT=Binding Component
59.28 +SHARED_LIBRARIES=Shared Libraries
59.29 +SHARED_LIBRARY=Shared Library
59.30 +SERVICE_ASSEMBLIES=Service Assemblies
59.31 +SERVICE_ASSEMBLY=Service Assembly
59.32 +SERVICE_UNIT=Service Unit
59.33 +
59.34 +
59.35 +JBI_SHORT_DESC=JBI meta-container
59.36 +SERVICE_ENGINES_SHORT_DESC=Service Engines are containers that provide services for Business Logic, Processing, transformation, and routing services.
59.37 +SERVICE_ENGINE_SHORT_DESC=Service Engine (short desc. here)
59.38 +BINDING_COMPONENTS_SHORT_DESC=Binding Components provide a proxy for services in the JBI environment to access remote services requiring a particular protocol. They can also facilitate a remote service consumer to access services in the JBI environment.
59.39 +BINDING_COMPONENT_SHORT_DESC=Binding Component (short desc. here)
59.40 +SHARED_LIBRARIES_SHORT_DESC=Shared Libraries contain common code shared by multiple JBI container components deployed on the JBI meta-container.
59.41 +SHARED_LIBRARY_SHORT_DESC=Shared Library (short desc. here)
59.42 +SERVICE_ASSEMBLIES_SHORT_DESC=Service Assemblies are deployment artifacts. Each Service Assemby can package one or more Service Units and defines the target components (SEs or BCs) to deploy the Service Units to.
59.43 +SERVICE_ASSEMBLY_SHORT_DESC=Service Assembly (short desc. here)
59.44 +SERVICE_UNIT_SHORT_DESC=Service Units can be deployed to installed JBI component containers like Binding Components and Service Engines.
59.45 +
59.46 +#progress
59.47 +LBL_Installing_Service_Engine=Installing Service Engine(s)...
59.48 +LBL_Starting_Service_Engine=Starting Service Engine {0}...
59.49 +LBL_Stopping_Service_Engine=Stopping Service Engine {0}...
59.50 +LBL_Shutting_Down_Service_Engine=Shutting down Service Engine {0}...
59.51 +LBL_Uninstalling_Service_Engine=Uninstalling Service Engine {0}...
59.52 +
59.53 +LBL_Installing_Binding_Component=Installing Binding Component(s)...
59.54 +LBL_Starting_Binding_Component=Starting Binding Component {0}...
59.55 +LBL_Stopping_Binding_Component=Stopping Binding Component {0}...
59.56 +LBL_Shutting_Down_Binding_Component=Shutting down Binding Component {0}...
59.57 +LBL_Uninstalling_Binding_Component=Uninstalling Binding Component {0}...
59.58 +
59.59 +LBL_Installing_Shared_Library=Installing Shared Libraries...
59.60 +LBL_Uninstalling_Shared_Library=Uninstalling Shared Library {0}...
59.61 +
59.62 +LBL_Deploying_Service_Assembly=Deploying Service Assemblies...
59.63 +LBL_Starting_Service_Assembly=Starting Service Assembly {0}...
59.64 +LBL_Stopping_Service_Assembly=Stopping Service Assembly {0}...
59.65 +LBL_Shutting_Down_Service_Assembly=Shutting down Service Assembly {0}...
59.66 +LBL_Undeploying_Service_Assembly=Undeploying Service Assembly {0}...
59.67 +
59.68 +#misc
59.69 +LBL_Deploy_Service_Assembly_Chooser_Name=Choose Service Assembly
59.70 +LBL_Deploy_Service_Assembly_Button=Deploy
59.71 +Deploy_Service_Assembly_Button_Mnemonic=d
59.72 +
59.73 +LBL_Install_Service_Engine_Chooser_Name=Choose Service Engine
59.74 +LBL_Install_Binding_Component_Chooser_Name=Choose Binding Component
59.75 +LBL_Install_Shared_Library_Chooser_Name=Choose Shared Library
59.76 +LBL_Install_JBI_Component_Button=Install
59.77 +Install_JBI_Component_Button_Mnemonic=i
60.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
60.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/Deployable.java Fri Oct 20 12:37:37 2006 +0000
60.3 @@ -0,0 +1,37 @@
60.4 +/*
60.5 + * The contents of this file are subject to the terms of the Common Development
60.6 + * and Distribution License (the License). You may not use this file except in
60.7 + * compliance with the License.
60.8 + *
60.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
60.10 + * or http://www.netbeans.org/cddl.txt.
60.11 +
60.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
60.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
60.14 + * If applicable, add the following below the CDDL Header, with the fields
60.15 + * enclosed by brackets [] replaced by your own identifying information:
60.16 + * "Portions Copyrighted [year] [name of copyright owner]"
60.17 + *
60.18 + * The Original Software is NetBeans. The Initial Developer of the Original
60.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
60.20 + * Microsystems, Inc. All Rights Reserved.
60.21 + */
60.22 +
60.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
60.24 +
60.25 +
60.26 +/**
60.27 + *
60.28 + * @author jqian
60.29 + */
60.30 +public interface Deployable {
60.31 +
60.32 +
60.33 + /**
60.34 + *
60.35 + *
60.36 + */
60.37 + public void deploy();
60.38 +
60.39 +
60.40 +}
61.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
61.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/IconConstants.java Fri Oct 20 12:37:37 2006 +0000
61.3 @@ -0,0 +1,49 @@
61.4 +/*
61.5 + * The contents of this file are subject to the terms of the Common Development
61.6 + * and Distribution License (the License). You may not use this file except in
61.7 + * compliance with the License.
61.8 + *
61.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
61.10 + * or http://www.netbeans.org/cddl.txt.
61.11 +
61.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
61.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
61.14 + * If applicable, add the following below the CDDL Header, with the fields
61.15 + * enclosed by brackets [] replaced by your own identifying information:
61.16 + * "Portions Copyrighted [year] [name of copyright owner]"
61.17 + *
61.18 + * The Original Software is NetBeans. The Initial Developer of the Original
61.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
61.20 + * Microsystems, Inc. All Rights Reserved.
61.21 + */
61.22 +
61.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
61.24 +
61.25 +/**
61.26 + * Defines all the icons used in the JBI Manager.
61.27 + *
61.28 + * @author jqian
61.29 + */
61.30 +public interface IconConstants {
61.31 +
61.32 + public static final String JBI_ICON = "resources/JBI.png"; // NOI18N
61.33 +
61.34 + public static final String SERVICE_ENGINES_BADGE_ICON = "resources/ServiceEngineBadge.png"; // NOI18N
61.35 + public static final String BINDING_COMPONENTS_BADGE_ICON = "resources/BindingComponentBadge.png"; // NOI18N
61.36 + public static final String SHARED_LIBRARIES_BADGE_ICON = "resources/SharedLibraryBadge.png"; // NOI18N
61.37 + public static final String SERVICE_ASSEMBLIES_BADGE_ICON = "resources/ServiceAssemblyBadge.png"; // NOI18N
61.38 +
61.39 + public static final String SERVICE_ENGINE_ICON = "resources/ServiceEngine.png"; // NOI18N
61.40 + public static final String BINDING_COMPONENT_ICON = "resources/BindingComponent.png"; // NOI18N
61.41 + public static final String SHARED_LIBRARY_ICON = "resources/SharedLibrary.png"; // NOI18N
61.42 + public static final String SERVICE_ASSEMBLY_ICON = "resources/ServiceAssembly.png"; // NOI18N
61.43 + public static final String SERVICE_UNIT_ICON = "resources/ServiceUnit.png"; // NOI18N
61.44 +
61.45 + public static final String FOLDER_ICON = "resources/folder.png"; // NOI18N
61.46 +
61.47 + public static final String INSTALLED_ICON = "resources/not_deployed.png"; // NOI18N
61.48 + public static final String STOPPED_ICON = "resources/down.png"; // NOI18N
61.49 + public static final String UNKNOWN_ICON = "resources/unknown.png"; // NOI18N
61.50 +
61.51 + public static final String BUSY_ICON = "resources/waiting.png"; // NOI18N
61.52 +}
62.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
62.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/Installable.java Fri Oct 20 12:37:37 2006 +0000
62.3 @@ -0,0 +1,37 @@
62.4 +/*
62.5 + * The contents of this file are subject to the terms of the Common Development
62.6 + * and Distribution License (the License). You may not use this file except in
62.7 + * compliance with the License.
62.8 + *
62.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
62.10 + * or http://www.netbeans.org/cddl.txt.
62.11 +
62.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
62.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
62.14 + * If applicable, add the following below the CDDL Header, with the fields
62.15 + * enclosed by brackets [] replaced by your own identifying information:
62.16 + * "Portions Copyrighted [year] [name of copyright owner]"
62.17 + *
62.18 + * The Original Software is NetBeans. The Initial Developer of the Original
62.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
62.20 + * Microsystems, Inc. All Rights Reserved.
62.21 + */
62.22 +
62.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
62.24 +
62.25 +
62.26 +/**
62.27 + *
62.28 + * @author jqian
62.29 + */
62.30 +public interface Installable {
62.31 +
62.32 +
62.33 + /**
62.34 + *
62.35 + *
62.36 + */
62.37 + public void install();
62.38 +
62.39 +
62.40 +}
63.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
63.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/JBIComponentContainerNode.java Fri Oct 20 12:37:37 2006 +0000
63.3 @@ -0,0 +1,324 @@
63.4 +/*
63.5 + * The contents of this file are subject to the terms of the Common Development
63.6 + * and Distribution License (the License). You may not use this file except in
63.7 + * compliance with the License.
63.8 + *
63.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
63.10 + * or http://www.netbeans.org/cddl.txt.
63.11 +
63.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
63.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
63.14 + * If applicable, add the following below the CDDL Header, with the fields
63.15 + * enclosed by brackets [] replaced by your own identifying information:
63.16 + * "Portions Copyrighted [year] [name of copyright owner]"
63.17 + *
63.18 + * The Original Software is NetBeans. The Initial Developer of the Original
63.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
63.20 + * Microsystems, Inc. All Rights Reserved.
63.21 + */
63.22 +
63.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
63.24 +
63.25 +import java.awt.Image;
63.26 +import java.io.File;
63.27 +import java.util.Map;
63.28 +import java.util.ResourceBundle;
63.29 +
63.30 +import javax.management.Attribute;
63.31 +import javax.swing.Action;
63.32 +import javax.swing.JFileChooser;
63.33 +import javax.swing.SwingUtilities;
63.34 +
63.35 +import org.netbeans.modules.j2ee.sun.bridge.apis.RefreshAction;
63.36 +import org.netbeans.modules.sun.manager.jbi.GenericConstants;
63.37 +import org.netbeans.modules.sun.manager.jbi.management.JBIMBeanTaskResultHandler;
63.38 +import org.netbeans.modules.sun.manager.jbi.util.ProgressUI;
63.39 +import org.netbeans.modules.sun.manager.jbi.actions.InstallAction;
63.40 +import org.netbeans.modules.sun.manager.jbi.management.AdministrationService;
63.41 +import org.netbeans.modules.sun.manager.jbi.util.AppserverJBIMgmtController;
63.42 +import org.netbeans.modules.sun.manager.jbi.util.JarFileFilter;
63.43 +import org.netbeans.modules.sun.manager.jbi.util.NodeTypes;
63.44 +import org.netbeans.modules.sun.manager.jbi.util.Utils;
63.45 +import org.openide.util.NbBundle;
63.46 +import org.openide.util.actions.SystemAction;
63.47 +import org.openide.util.HelpCtx;
63.48 +
63.49 +/**
63.50 + * Container node for all JBI Components of the same type.
63.51 + *
63.52 + * @author jqian
63.53 + */
63.54 +public abstract class JBIComponentContainerNode extends AppserverJBIMgmtContainerNode
63.55 + implements Installable {
63.56 +
63.57 + private static String lastInstallDir = null;
63.58 +
63.59 + private boolean busy;
63.60 +
63.61 + public JBIComponentContainerNode(final AppserverJBIMgmtController controller,
63.62 + final String type, final String name) {
63.63 + super(controller, type);
63.64 + setDisplayName(name);
63.65 + }
63.66 +
63.67 + /**
63.68 + * Return the actions associated with the menu drop down seen when
63.69 + * a user right-clicks on a node in the plugin.
63.70 + *
63.71 + * @param boolean true/false
63.72 + * @return An array of Action objects.
63.73 + */
63.74 + public Action[] getActions(boolean flag) {
63.75 + return new SystemAction[] {
63.76 + SystemAction.get(getInstallActionClass()),
63.77 + SystemAction.get(RefreshAction.class),
63.78 + };
63.79 + }
63.80 +
63.81 + /**
63.82 + *
63.83 + */
63.84 + public Image getIcon(int type) {
63.85 + String iconName = IconConstants.FOLDER_ICON;
63.86 + String badgeIconName = getBadgeIconName();
63.87 + String externalBadgeIconName = busy ? IconConstants.BUSY_ICON : null;
63.88 + return Utils.getBadgedIcon(getClass(), iconName, badgeIconName, externalBadgeIconName);
63.89 + }
63.90 +
63.91 + /**
63.92 + *
63.93 + */
63.94 + public Image getOpenedIcon(int type) {
63.95 + return getIcon(type);
63.96 + }
63.97 +
63.98 + /**
63.99 + *
63.100 + * @param busy
63.101 + */
63.102 + private void setBusy(boolean busy) {
63.103 + this.busy = busy;
63.104 + fireIconChange();
63.105 + }
63.106 +
63.107 + protected Map getSheetProperties() {
63.108 + return null;
63.109 + }
63.110 +
63.111 + public Attribute setSheetProperty(String attrName, Object value) {
63.112 + return null;
63.113 + }
63.114 +
63.115 + /**
63.116 + * Installs new JBI Component(s).
63.117 + */
63.118 + public void install() {
63.119 +
63.120 + AdministrationService adminService =
63.121 + getAppserverJBIMgmtController().getJBIAdministrationService();
63.122 +
63.123 + if (adminService != null) {
63.124 + JFileChooser chooser = getJFileChooser();
63.125 + int returnValue = chooser.showDialog(null,
63.126 + NbBundle.getMessage(JBIComponentContainerNode.class, "LBL_Install_JBI_Component_Button")); //NOI18N
63.127 +
63.128 + if (returnValue == JFileChooser.APPROVE_OPTION){
63.129 + File[] selectedFiles = chooser.getSelectedFiles();
63.130 +
63.131 + String progressLabel = getInstallProgressMessageLabel();
63.132 + String message = NbBundle.getMessage(JBIComponentContainerNode.class, progressLabel);
63.133 + final ProgressUI progressUI = new ProgressUI(message, false);
63.134 +
63.135 + SwingUtilities.invokeLater(new Runnable() {
63.136 + public void run() {
63.137 + setBusy(true);
63.138 + progressUI.start();
63.139 + }
63.140 + });
63.141 +
63.142 + for (int i = 0; i < selectedFiles.length; i++) {
63.143 + final String jarFilePath = selectedFiles[i].getAbsolutePath();
63.144 + final String result = installJBIComponent(jarFilePath);
63.145 +
63.146 + SwingUtilities.invokeLater(new Runnable() {
63.147 + public void run() {
63.148 + JBIMBeanTaskResultHandler.showRemoteInvokationResult(
63.149 + GenericConstants.INSTALL_COMPONENT_OPERATION_NAME,
63.150 + jarFilePath, result);
63.151 + }
63.152 + });
63.153 +
63.154 + if (i == 0) {
63.155 + lastInstallDir = selectedFiles[0].getParent();
63.156 + }
63.157 + }
63.158 +
63.159 + SwingUtilities.invokeLater(new Runnable() {
63.160 + public void run() {
63.161 + progressUI.finish();
63.162 + setBusy(false);
63.163 + }
63.164 + });
63.165 + }
63.166 + }
63.167 + }
63.168 +
63.169 + protected AdministrationService getJBIAdministrationService() {
63.170 + return getAppserverJBIMgmtController().getJBIAdministrationService();
63.171 + }
63.172 +
63.173 + private JFileChooser getJFileChooser(){
63.174 + JFileChooser chooser = new JFileChooser();
63.175 +
63.176 + ResourceBundle bundle = NbBundle.getBundle(JBIComponentContainerNode.class);
63.177 +
63.178 + String titleLabel = getFileChooserTitleLabel();
63.179 + chooser.setDialogTitle(bundle.getString(titleLabel));
63.180 + chooser.setDialogType(JFileChooser.CUSTOM_DIALOG);
63.181 +
63.182 + chooser.setApproveButtonMnemonic(
63.183 + bundle.getString("Install_JBI_Component_Button_Mnemonic").charAt(0)); //NOI18N
63.184 + chooser.setMultiSelectionEnabled(true);
63.185 + chooser.addChoosableFileFilter(JarFileFilter.getInstance());
63.186 + chooser.setAcceptAllFileFilterUsed(false);
63.187 + chooser.setApproveButtonToolTipText(
63.188 + bundle.getString("LBL_Install_JBI_Component_Button")); //NOI18N
63.189 +
63.190 + chooser.getAccessibleContext().setAccessibleName(
63.191 + bundle.getString(titleLabel));
63.192 + chooser.getAccessibleContext().setAccessibleDescription(
63.193 + bundle.getString(titleLabel));
63.194 +
63.195 + if (lastInstallDir != null) {
63.196 + chooser.setCurrentDirectory(new File(lastInstallDir));
63.197 + }
63.198 +
63.199 + return chooser;
63.200 + }
63.201 +
63.202 + protected abstract Class getInstallActionClass();
63.203 +
63.204 + protected abstract String installJBIComponent(String jarFilePath);
63.205 +
63.206 + protected abstract String getFileChooserTitleLabel();
63.207 +
63.208 + protected abstract String getInstallProgressMessageLabel();
63.209 +
63.210 + protected abstract String getBadgeIconName();
63.211 +
63.212 + //==========================================================================
63.213 +
63.214 +
63.215 + /**
63.216 + * Container node for all JBI Service Engines.
63.217 + */
63.218 + public static class ServiceEngines extends JBIComponentContainerNode {
63.219 +
63.220 + public ServiceEngines(final AppserverJBIMgmtController controller) {
63.221 + super(controller,
63.222 + NodeTypes.SERVICE_ENGINES,
63.223 + NbBundle.getMessage(JBIComponentContainerNode.class, "SERVICE_ENGINES")); // NOI18N
63.224 + }
63.225 +
63.226 + protected Class getInstallActionClass() {
63.227 + return InstallAction.ServiceEngine.class;
63.228 + }
63.229 +
63.230 + protected String installJBIComponent(String jarFilePath) {
63.231 + AdministrationService adminService = getJBIAdministrationService();
63.232 + return adminService.installComponent(jarFilePath);
63.233 + }
63.234 +
63.235 + protected String getFileChooserTitleLabel() {
63.236 + return "LBL_Install_Service_Engine_Chooser_Name"; // NOI18N
63.237 + }
63.238 +
63.239 + protected String getInstallProgressMessageLabel() {
63.240 + return "LBL_Installing_Service_Engine"; // NOI18N
63.241 + }
63.242 +
63.243 + protected String getBadgeIconName() {
63.244 + return IconConstants.SERVICE_ENGINES_BADGE_ICON;
63.245 + }
63.246 +
63.247 + public HelpCtx getHelpCtx() {
63.248 + return new HelpCtx(this.getClass());
63.249 + }
63.250 + }
63.251 +
63.252 +
63.253 + /**
63.254 + * Container node for all JBI Binding Components.
63.255 + */
63.256 + public static class BindingComponents extends JBIComponentContainerNode {
63.257 +
63.258 + public BindingComponents(final AppserverJBIMgmtController controller) {
63.259 + super(controller,
63.260 + NodeTypes.BINDING_COMPONENTS,
63.261 + NbBundle.getMessage(JBIComponentContainerNode.class, "BINDING_COMPONENTS")); // NOI18N
63.262 + }
63.263 +
63.264 + protected Class getInstallActionClass() {
63.265 + return InstallAction.BindingComponent.class;
63.266 + }
63.267 +
63.268 + protected String installJBIComponent(String jarFilePath) {
63.269 + AdministrationService adminService = getJBIAdministrationService();
63.270 + return adminService.installComponent(jarFilePath);
63.271 + }
63.272 +
63.273 + protected String getFileChooserTitleLabel() {
63.274 + return "LBL_Install_Binding_Component_Chooser_Name"; // NOI18N
63.275 + }
63.276 +
63.277 + protected String getInstallProgressMessageLabel() {
63.278 + return "LBL_Installing_Binding_Component"; // NOI18N
63.279 + }
63.280 +
63.281 + protected String getBadgeIconName() {
63.282 + return IconConstants.BINDING_COMPONENTS_BADGE_ICON;
63.283 + }
63.284 +
63.285 + public HelpCtx getHelpCtx() {
63.286 + return new HelpCtx(this.getClass());
63.287 + }
63.288 + }
63.289 +
63.290 +
63.291 + /**
63.292 + * Container node for all JBI Shared Libraries.
63.293 + */
63.294 + public static class SharedLibraries extends JBIComponentContainerNode {
63.295 +
63.296 + public SharedLibraries(final AppserverJBIMgmtController controller) {
63.297 + super(controller,
63.298 + NodeTypes.SHARED_LIBRARIES,
63.299 + NbBundle.getMessage(JBIComponentContainerNode.class, "SHARED_LIBRARIES")); // NOI18N
63.300 + }
63.301 +
63.302 + protected Class getInstallActionClass() {
63.303 + return InstallAction.SharedLibrary.class;
63.304 + }
63.305 +
63.306 + protected String installJBIComponent(String jarFilePath) {
63.307 + AdministrationService adminService = getJBIAdministrationService();
63.308 + return adminService.installSharedLibrary(jarFilePath);
63.309 + }
63.310 +
63.311 + protected String getFileChooserTitleLabel() {
63.312 + return "LBL_Install_Shared_Library_Chooser_Name"; // NOI18N
63.313 + }
63.314 +
63.315 + protected String getInstallProgressMessageLabel() {
63.316 + return "LBL_Installing_Shared_Library"; // NOI18N
63.317 + }
63.318 +
63.319 + protected String getBadgeIconName() {
63.320 + return IconConstants.SHARED_LIBRARIES_BADGE_ICON;
63.321 + }
63.322 +
63.323 + public HelpCtx getHelpCtx() {
63.324 + return new HelpCtx(this.getClass());
63.325 + }
63.326 + }
63.327 +}
64.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
64.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/JBIComponentNode.java Fri Oct 20 12:37:37 2006 +0000
64.3 @@ -0,0 +1,603 @@
64.4 +/*
64.5 + * The contents of this file are subject to the terms of the Common Development
64.6 + * and Distribution License (the License). You may not use this file except in
64.7 + * compliance with the License.
64.8 + *
64.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
64.10 + * or http://www.netbeans.org/cddl.txt.
64.11 +
64.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
64.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
64.14 + * If applicable, add the following below the CDDL Header, with the fields
64.15 + * enclosed by brackets [] replaced by your own identifying information:
64.16 + * "Portions Copyrighted [year] [name of copyright owner]"
64.17 + *
64.18 + * The Original Software is NetBeans. The Initial Developer of the Original
64.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
64.20 + * Microsystems, Inc. All Rights Reserved.
64.21 + */
64.22 +
64.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
64.24 +
64.25 +import java.awt.Image;
64.26 +import java.util.HashMap;
64.27 +import java.util.Map;
64.28 +
64.29 +import javax.management.Attribute;
64.30 +import javax.management.MBeanAttributeInfo;
64.31 +import javax.swing.Action;
64.32 +import javax.swing.SwingUtilities;
64.33 +import org.netbeans.modules.sun.manager.jbi.management.JBIMBeanTaskResultHandler;
64.34 +import org.netbeans.modules.sun.manager.jbi.management.model.JBIServiceAssemblyStatus;
64.35 +
64.36 +import org.netbeans.modules.sun.manager.jbi.util.ProgressUI;
64.37 +import org.netbeans.modules.sun.manager.jbi.GenericConstants;
64.38 +import org.netbeans.modules.sun.manager.jbi.actions.ShutdownAction;
64.39 +import org.netbeans.modules.sun.manager.jbi.actions.StartAction;
64.40 +import org.netbeans.modules.sun.manager.jbi.actions.StopAction;
64.41 +import org.netbeans.modules.sun.manager.jbi.actions.UninstallAction;
64.42 +import org.netbeans.modules.sun.manager.jbi.management.AdministrationService;
64.43 +import org.netbeans.modules.sun.manager.jbi.management.model.JBIComponentStatus;
64.44 +import org.netbeans.modules.sun.manager.jbi.util.AppserverJBIMgmtController;
64.45 +import org.netbeans.modules.sun.manager.jbi.util.NodeTypes;
64.46 +import org.netbeans.modules.sun.manager.jbi.util.Utils;
64.47 +import org.openide.nodes.Sheet;
64.48 +import org.openide.DialogDisplayer;
64.49 +import org.openide.NotifyDescriptor;
64.50 +import org.openide.actions.PropertiesAction;
64.51 +import org.openide.util.NbBundle;
64.52 +import org.openide.util.actions.SystemAction;
64.53 +
64.54 +/**
64.55 + * Abstract Node class for a JBI Component.
64.56 + *
64.57 + * @author jqian
64.58 + */
64.59 +public abstract class JBIComponentNode extends AppserverJBIMgmtLeafNode
64.60 + implements /*RefreshCookie,*/ Startable, Stoppable, Shutdownable, Uninstallable {
64.61 +
64.62 + private boolean busy;
64.63 +
64.64 + private JBIComponentStatus cachedComponentStatus;
64.65 +
64.66 + public JBIComponentNode(final AppserverJBIMgmtController controller,
64.67 + final String nodeType,
64.68 + final String name,
64.69 + final String description) {
64.70 + super(controller, nodeType);
64.71 + setName(name);
64.72 + setDisplayName(name);
64.73 + setShortDescription(description);
64.74 + }
64.75 +
64.76 + /**
64.77 + * Return the SheetProperties to be displayed for this JBIComponent.
64.78 + *
64.79 + * @return A java.util.Map containing all JBIComponent properties.
64.80 + */
64.81 + protected Map<Attribute, MBeanAttributeInfo> getSheetProperties() {
64.82 + JBIComponentStatus jbiComponent = getJBIComponentStatus();
64.83 + Map<Attribute, MBeanAttributeInfo> map = Utils.getIntrospectedPropertyMap(jbiComponent, true);
64.84 +
64.85 + AppserverJBIMgmtController controller = getAppserverJBIMgmtController();
64.86 +
64.87 + try {
64.88 + String containerType = getContainerType();
64.89 + Map<Attribute, MBeanAttributeInfo> configMap =
64.90 + controller.getJBIComponentConfigProperties(containerType, getName(), true);
64.91 + if (configMap != null) {
64.92 + map.putAll(configMap);
64.93 + }
64.94 + } catch (Exception e) {
64.95 + NotifyDescriptor d = new NotifyDescriptor.Message(e.getMessage(),
64.96 + NotifyDescriptor.ERROR_MESSAGE);
64.97 + DialogDisplayer.getDefault().notify(d);
64.98 + }
64.99 + return map;
64.100 + }
64.101 +
64.102 + /**
64.103 + * Sets the property as an attribute to the underlying AMX mbeans. It
64.104 + * usually will delegate to the controller object which is responsible for
64.105 + * finding the correct AMX mbean objectname in order to execute a
64.106 + * JMX setAttribute.
64.107 + *
64.108 + * @param attrName The name of the property to be set.
64.109 + * @param value The value retrieved from the property sheet to be set in the
64.110 + * backend.
64.111 + * @returns the updated Attribute accessed from the Sheet.
64.112 + */
64.113 + public Attribute setSheetProperty(String attrName, Object value) {
64.114 +
64.115 + try {
64.116 + String containerType = getContainerType();
64.117 + AppserverJBIMgmtController controller = getAppserverJBIMgmtController();
64.118 + controller.setJBIComponentConfigProperty(
64.119 + containerType, getName(), attrName, value);
64.120 +
64.121 + // Get the new value
64.122 + Object newValue = controller.getJBIComponentConfigPropertyValue(
64.123 + containerType, getName(), attrName);
64.124 +
64.125 + updatePropertySheet();
64.126 +
64.127 + return new Attribute(attrName, newValue);
64.128 + } catch (Exception e) {
64.129 + NotifyDescriptor d = new NotifyDescriptor.Message(e.getMessage(),
64.130 + NotifyDescriptor.ERROR_MESSAGE);
64.131 + DialogDisplayer.getDefault().notify(d);
64.132 + }
64.133 +
64.134 + return null;
64.135 + }
64.136 +
64.137 + /**
64.138 + *
64.139 + */
64.140 + public Image getIcon(int type) {
64.141 + String state = getState(false);
64.142 + String iconName = getIconName(state);
64.143 +
64.144 + String externalBadgeIconName = null;
64.145 + if (busy) {
64.146 + externalBadgeIconName = IconConstants.BUSY_ICON;
64.147 + } else {
64.148 + if (JBIComponentStatus.INSTALLED_STATE.equals(state)) {
64.149 + externalBadgeIconName = getInstalledIconBadgeName();
64.150 + } else if (JBIComponentStatus.STOPPED_STATE.equals(state)) {
64.151 + externalBadgeIconName = getStoppedIconBadgeName();
64.152 + } else if (!JBIComponentStatus.STARTED_STATE.equals(state)) {
64.153 + externalBadgeIconName = getUnknownIconBadgeName();
64.154 + }
64.155 + }
64.156 +
64.157 + return Utils.getBadgedIcon(getClass(), iconName, null, externalBadgeIconName);
64.158 + }
64.159 +
64.160 + protected String getInstalledIconBadgeName() {
64.161 + return IconConstants.INSTALLED_ICON;
64.162 + }
64.163 +
64.164 + protected String getStoppedIconBadgeName() {
64.165 + return IconConstants.STOPPED_ICON;
64.166 + }
64.167 +
64.168 + protected String getUnknownIconBadgeName() {
64.169 + return IconConstants.UNKNOWN_ICON;
64.170 + }
64.171 +
64.172 + /**
64.173 + *
64.174 + * @param busy
64.175 + */
64.176 + private void setBusy(boolean busy) {
64.177 + this.busy = busy;
64.178 + fireIconChange();
64.179 + }
64.180 +
64.181 + /**
64.182 + *
64.183 + * @return
64.184 + */
64.185 + private JBIComponentStatus getJBIComponentStatus() {
64.186 + return getJBIComponentStatus(false); // non-cached by default
64.187 + }
64.188 +
64.189 + private JBIComponentStatus getJBIComponentStatus(boolean cached) {
64.190 + if (cachedComponentStatus == null || !cached) {
64.191 + cachedComponentStatus =
64.192 + getAppserverJBIMgmtController().getJBIComponentStatus(getName());
64.193 + }
64.194 +
64.195 + return cachedComponentStatus;
64.196 + }
64.197 +
64.198 + /**
64.199 + *
64.200 + * @return
64.201 + */
64.202 + private String getState(boolean cached) {
64.203 + String ret = null;
64.204 +
64.205 + JBIComponentStatus status = getJBIComponentStatus(cached);
64.206 + if (status != null) {
64.207 + ret = status.getState();
64.208 + }
64.209 +
64.210 + return ret;
64.211 + }
64.212 +
64.213 + private void updatePropertySheet() {
64.214 + Sheet sheet = createSheet();
64.215 + setSheet(sheet);
64.216 + firePropertySetsChange(null, null);
64.217 + }
64.218 +
64.219 + //========================== Startable =====================================
64.220 +
64.221 + /**
64.222 + *
64.223 + */
64.224 + public boolean canStart() {
64.225 + String state = getState(false);
64.226 + return !busy &&
64.227 + (JBIComponentStatus.STOPPED_STATE.equals(state) ||
64.228 + JBIComponentStatus.INSTALLED_STATE.equals(state));
64.229 + }
64.230 +
64.231 + /**
64.232 + *
64.233 + */
64.234 + public void start() {
64.235 + final AdministrationService adminService =
64.236 + getAppserverJBIMgmtController().getJBIAdministrationService();
64.237 +
64.238 + if (adminService != null) {
64.239 +
64.240 + String progressLabel = getStartProgressLabel();
64.241 + final String componentName = getName();
64.242 + String title =
64.243 + NbBundle.getMessage(JBIComponentNode.class, progressLabel,
64.244 + new Object[] {componentName});
64.245 + final ProgressUI progressUI = new ProgressUI(title, false);
64.246 +
64.247 + SwingUtilities.invokeLater(new Runnable() {
64.248 + public void run() {
64.249 + setBusy(true);
64.250 + progressUI.start();
64.251 + }
64.252 + });
64.253 +
64.254 + final String result = adminService.startComponent(componentName);
64.255 +
64.256 + SwingUtilities.invokeLater(new Runnable() {
64.257 + public void run() {
64.258 + progressUI.finish();
64.259 + JBIMBeanTaskResultHandler.showRemoteInvokationResult(
64.260 + GenericConstants.START_COMPONENT_OPERATION_NAME,
64.261 + componentName, result);
64.262 + setBusy(false);
64.263 + }
64.264 + });
64.265 +
64.266 + updatePropertySheet();
64.267 + }
64.268 + }
64.269 +
64.270 + //========================== Stoppable =====================================
64.271 +
64.272 + /**
64.273 + *
64.274 + */
64.275 + public boolean canStop() {
64.276 + return !busy && JBIComponentStatus.STARTED_STATE.equals(getState(true)); // cached
64.277 + }
64.278 +
64.279 + /**
64.280 + *
64.281 + */
64.282 + public void stop() {
64.283 + AdministrationService adminService =
64.284 + getAppserverJBIMgmtController().getJBIAdministrationService();
64.285 +
64.286 + if (adminService != null) {
64.287 +
64.288 + String progressLabel = getStopProgressLabel();
64.289 + final String componentName = getName();
64.290 + String title =
64.291 + NbBundle.getMessage(JBIComponentNode.class, progressLabel,
64.292 + new Object[] {componentName});
64.293 + final ProgressUI progressUI = new ProgressUI(title, false);
64.294 +
64.295 + SwingUtilities.invokeLater(new Runnable() {
64.296 + public void run() {
64.297 + setBusy(true);
64.298 + progressUI.start();
64.299 + }
64.300 + });
64.301 +
64.302 + final String result = adminService.stopComponent(componentName);
64.303 +
64.304 + SwingUtilities.invokeLater(new Runnable() {
64.305 + public void run() {
64.306 + progressUI.finish();
64.307 + JBIMBeanTaskResultHandler.showRemoteInvokationResult(
64.308 + GenericConstants.STOP_COMPONENT_OPERATION_NAME,
64.309 + componentName, result);
64.310 + setBusy(false);
64.311 + }
64.312 + });
64.313 +
64.314 + updatePropertySheet();
64.315 + }
64.316 + }
64.317 +
64.318 + //========================== Shutdownable ==================================
64.319 +
64.320 + /**
64.321 + *
64.322 + */
64.323 + public boolean canShutdown() {
64.324 + return !busy && JBIComponentStatus.STOPPED_STATE.equals(getState(true)); // cached
64.325 + }
64.326 +
64.327 + /**
64.328 + *
64.329 + */
64.330 + public void shutdown() {
64.331 + AdministrationService adminService =
64.332 + getAppserverJBIMgmtController().getJBIAdministrationService();
64.333 +
64.334 + if (adminService != null) {
64.335 +
64.336 + String progressLabel = getShutdownProgressLabel();
64.337 + final String componentName = getName();
64.338 + String title =
64.339 + NbBundle.getMessage(JBIComponentNode.class, progressLabel,
64.340 + new Object[] {componentName});
64.341 + final ProgressUI progressUI = new ProgressUI(title, false);
64.342 +
64.343 + SwingUtilities.invokeLater(new Runnable() {
64.344 + public void run() {
64.345 + setBusy(true);
64.346 + progressUI.start();
64.347 + }
64.348 + });
64.349 +
64.350 + final String result = adminService.shutdownComponent(componentName);
64.351 +
64.352 + SwingUtilities.invokeLater(new Runnable() {
64.353 + public void run() {
64.354 + progressUI.finish();
64.355 + JBIMBeanTaskResultHandler.showRemoteInvokationResult(
64.356 + GenericConstants.SHUTDOWN_COMPONENT_OPERATION_NAME,
64.357 + componentName, result);
64.358 + setBusy(false);
64.359 + }
64.360 + });
64.361 +
64.362 + updatePropertySheet();
64.363 + }
64.364 + }
64.365 +
64.366 + //========================== Uninstallable =================================
64.367 +
64.368 + /**
64.369 + *
64.370 + */
64.371 + public boolean canUninstall() {
64.372 + return !busy && JBIComponentStatus.INSTALLED_STATE.equals(getState(true)); // cached
64.373 + }
64.374 +
64.375 + /**
64.376 + *
64.377 + */
64.378 + public void uninstall() {
64.379 + AdministrationService adminService =
64.380 + getAppserverJBIMgmtController().getJBIAdministrationService();
64.381 +
64.382 + if (adminService != null) {
64.383 +
64.384 + String progressLabel = getUninstallProgressLabel();
64.385 + final String componentName = getName();
64.386 + String title =
64.387 + NbBundle.getMessage(JBIComponentNode.class, progressLabel,
64.388 + new Object[] {componentName});
64.389 + final ProgressUI progressUI = new ProgressUI(title, false);
64.390 +
64.391 + SwingUtilities.invokeLater(new Runnable() {
64.392 + public void run() {
64.393 + progressUI.start();
64.394 + }
64.395 + });
64.396 +
64.397 + final String result = uninstallComponent(adminService, componentName);
64.398 +
64.399 + SwingUtilities.invokeLater(new Runnable() {
64.400 + public void run() {
64.401 + progressUI.finish();
64.402 + JBIMBeanTaskResultHandler.showRemoteInvokationResult(
64.403 + GenericConstants.UNINSTALL_COMPONENT_OPERATION_NAME,
64.404 + componentName, result);
64.405 + }
64.406 + });
64.407 +
64.408 + updatePropertySheet();
64.409 + }
64.410 + }
64.411 +
64.412 + //===================== Abstract Methods ===================================
64.413 +
64.414 + protected abstract String getContainerType();
64.415 +
64.416 + protected abstract String getIconName(String state);
64.417 +
64.418 + protected abstract String getStartProgressLabel();
64.419 +
64.420 + protected abstract String getStopProgressLabel();
64.421 +
64.422 + protected abstract String getShutdownProgressLabel();
64.423 +
64.424 + protected abstract String getUninstallProgressLabel();
64.425 +
64.426 + protected abstract String uninstallComponent(
64.427 + AdministrationService adminService, String componentName);
64.428 +
64.429 + //==========================================================================
64.430 +
64.431 +
64.432 +
64.433 + //========================= Concrete Nodes =================================
64.434 +
64.435 + /**
64.436 + * Node class for a Service Engine.
64.437 + */
64.438 + public static class ServiceEngine extends JBIComponentNode {
64.439 +
64.440 + private static final String NODE_TYPE = NodeTypes.SERVICE_ENGINE;
64.441 +
64.442 + public ServiceEngine(final AppserverJBIMgmtController controller,
64.443 + final String name, final String description) {
64.444 + super(controller, NODE_TYPE, name, description);
64.445 + }
64.446 +
64.447 + public Action[] getActions(boolean flag) {
64.448 + return new SystemAction[] {
64.449 + SystemAction.get(StartAction.class),
64.450 + SystemAction.get(StopAction.class),
64.451 + SystemAction.get(ShutdownAction.class),
64.452 + SystemAction.get(UninstallAction.class),
64.453 + null,
64.454 + SystemAction.get(PropertiesAction.class),
64.455 + };
64.456 + }
64.457 +
64.458 + protected String uninstallComponent(
64.459 + AdministrationService adminService, String componentName) {
64.460 + return adminService.uninstallComponent(componentName);
64.461 + }
64.462 +
64.463 + protected String getContainerType() {
64.464 + return GenericConstants.SERVICE_ENGINES_FOLDER_NAME;
64.465 + }
64.466 +
64.467 + protected String getIconName(String state) {
64.468 + return IconConstants.SERVICE_ENGINE_ICON;
64.469 + }
64.470 +
64.471 + protected String getStartProgressLabel() {
64.472 + return "LBL_Starting_Service_Engine"; // NOI18N
64.473 + }
64.474 +
64.475 + protected String getStopProgressLabel() {
64.476 + return "LBL_Stopping_Service_Engine"; // NOI18N
64.477 + }
64.478 +
64.479 + protected String getShutdownProgressLabel() {
64.480 + return "LBL_Shutting_Down_Service_Engine"; // NOI18N
64.481 + }
64.482 +
64.483 + protected String getUninstallProgressLabel() {
64.484 + return "LBL_Uninstalling_Service_Engine"; // NOI18N
64.485 + }
64.486 + }
64.487 +
64.488 + //==========================================================================
64.489 +
64.490 + /**
64.491 + * Node class for a Binding Component.
64.492 + */
64.493 + public static class BindingComponent extends JBIComponentNode {
64.494 +
64.495 + private static final String NODE_TYPE = NodeTypes.BINDING_COMPONENT;
64.496 +
64.497 + public BindingComponent(final AppserverJBIMgmtController controller,
64.498 + final String name, final String description) {
64.499 + super(controller, NODE_TYPE, name, description);
64.500 + }
64.501 +
64.502 + public Action[] getActions(boolean flag) {
64.503 + return new SystemAction[] {
64.504 + SystemAction.get(StartAction.class),
64.505 + SystemAction.get(StopAction.class),
64.506 + SystemAction.get(ShutdownAction.class),
64.507 + SystemAction.get(UninstallAction.class),
64.508 + null,
64.509 + SystemAction.get(PropertiesAction.class),
64.510 + };
64.511 + }
64.512 +
64.513 + protected String uninstallComponent(
64.514 + AdministrationService adminService, String componentName) {
64.515 + return adminService.uninstallComponent(componentName);
64.516 + }
64.517 +
64.518 + protected String getContainerType() {
64.519 + return GenericConstants.BINDING_COMPONENTS_FOLDER_NAME;
64.520 + }
64.521 +
64.522 + protected String getIconName(String state) {
64.523 + return IconConstants.BINDING_COMPONENT_ICON;
64.524 + }
64.525 +
64.526 + protected String getStartProgressLabel() {
64.527 + return "LBL_Starting_Binding_Component"; // NOI18N
64.528 + }
64.529 +
64.530 + protected String getStopProgressLabel() {
64.531 + return "LBL_Stopping_Binding_Component"; // NOI18N
64.532 + }
64.533 +
64.534 + protected String getShutdownProgressLabel() {
64.535 + return "LBL_Shutting_Down_Binding_Component"; // NOI18N
64.536 + }
64.537 +
64.538 + protected String getUninstallProgressLabel() {
64.539 + return "LBL_Uninstalling_Binding_Component"; // NOI18N
64.540 + }
64.541 + }
64.542 +
64.543 + //==========================================================================
64.544 +
64.545 + /**
64.546 + * Node class for a Shared Library.
64.547 + */
64.548 + public static class SharedLibrary extends JBIComponentNode {
64.549 +
64.550 + private static final String NODE_TYPE = NodeTypes.SHARED_LIBRARY;
64.551 +
64.552 + public SharedLibrary(final AppserverJBIMgmtController controller,
64.553 + final String name, final String description) {
64.554 + super(controller, NODE_TYPE, name, description);
64.555 + }
64.556 +
64.557 + public Action[] getActions(boolean flag) {
64.558 + return new SystemAction[] {
64.559 + SystemAction.get(UninstallAction.class),
64.560 + null,
64.561 + SystemAction.get(PropertiesAction.class),
64.562 + };
64.563 + }
64.564 +
64.565 + protected String uninstallComponent(
64.566 + AdministrationService adminService, String componentName) {
64.567 + return adminService.uninstallSharedLibrary(componentName);
64.568 + }
64.569 +
64.570 + protected String getContainerType() {
64.571 + return GenericConstants.SHARED_LIBRARIES_FOLDER_NAME;
64.572 + }
64.573 +
64.574 + protected String getIconName(String state) {
64.575 + return IconConstants.SHARED_LIBRARY_ICON;
64.576 + }
64.577 +
64.578 + protected String getStartProgressLabel() {
64.579 + return null;
64.580 + }
64.581 +
64.582 + protected String getStopProgressLabel() {
64.583 + return null;
64.584 + }
64.585 +
64.586 + protected String getShutdownProgressLabel() {
64.587 + return null;
64.588 + }
64.589 +
64.590 + protected String getUninstallProgressLabel() {
64.591 + return "LBL_Uninstalling_Shared_Library"; // NOI18N
64.592 + }
64.593 +
64.594 + protected String getInstalledIconBadgeName() {
64.595 + return null;
64.596 + }
64.597 +
64.598 + protected String getStoppedIconBadgeName() {
64.599 + return null;
64.600 + }
64.601 +
64.602 + protected String getUnknownIconBadgeName() {
64.603 + return null;
64.604 + }
64.605 + }
64.606 +}
65.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
65.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/JBINode.java Fri Oct 20 12:37:37 2006 +0000
65.3 @@ -0,0 +1,120 @@
65.4 +/*
65.5 + * The contents of this file are subject to the terms of the Common Development
65.6 + * and Distribution License (the License). You may not use this file except in
65.7 + * compliance with the License.
65.8 + *
65.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
65.10 + * or http://www.netbeans.org/cddl.txt.
65.11 +
65.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
65.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
65.14 + * If applicable, add the following below the CDDL Header, with the fields
65.15 + * enclosed by brackets [] replaced by your own identifying information:
65.16 + * "Portions Copyrighted [year] [name of copyright owner]"
65.17 + *
65.18 + * The Original Software is NetBeans. The Initial Developer of the Original
65.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
65.20 + * Microsystems, Inc. All Rights Reserved.
65.21 + */
65.22 +
65.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
65.24 +
65.25 +import java.awt.Image;
65.26 +import java.util.Map;
65.27 +
65.28 +import javax.management.Attribute;
65.29 +import javax.swing.Action;
65.30 +import javax.swing.ImageIcon;
65.31 +import javax.swing.SwingUtilities;
65.32 +
65.33 +import org.netbeans.modules.j2ee.sun.bridge.apis.AppserverMgmtController;
65.34 +import org.netbeans.modules.j2ee.sun.bridge.apis.RefreshAction;
65.35 +import org.netbeans.modules.sun.manager.jbi.management.JBIFrameworkService;
65.36 +import org.netbeans.modules.sun.manager.jbi.util.AppserverJBIMgmtController;
65.37 +import org.netbeans.modules.sun.manager.jbi.util.NodeTypes;
65.38 +import org.netbeans.modules.sun.manager.jbi.util.Utils;
65.39 +import org.openide.actions.PropertiesAction;
65.40 +import org.openide.util.actions.SystemAction;
65.41 +import org.openide.util.HelpCtx;
65.42 +
65.43 +/**
65.44 + * Top node for the JBI lifecycle module.
65.45 + *
65.46 + * @author jqian
65.47 + */
65.48 +public class JBINode extends AppserverJBIMgmtContainerNode {
65.49 +
65.50 + /** Creates a new instance of JBINode */
65.51 + public JBINode(final AppserverJBIMgmtController controller) {
65.52 + super(controller, NodeTypes.JBI);
65.53 +
65.54 +// SwingUtilities.invokeLater(new Runnable() {
65.55 +// public void run() {
65.56 +//// String serverDisplayName = getParentNode().getName();
65.57 +//// controller.setServerInstanceDisplayName(serverDisplayName);
65.58 +// controller.setJBINode(JBINode.this);
65.59 +// }
65.60 +// });
65.61 + }
65.62 +
65.63 + /**
65.64 + * Return the actions associated with the menu drop down seen when
65.65 + * a user right-clicks on an Applications node in the plugin.
65.66 + *
65.67 + * @param boolean true/false
65.68 + * @return An array of Action objects.
65.69 + */
65.70 + public Action[] getActions(boolean flag) {
65.71 + return new SystemAction[] {
65.72 + SystemAction.get(PropertiesAction.class),
65.73 + SystemAction.get(RefreshAction.class)
65.74 + };
65.75 + }
65.76 +
65.77 + /**
65.78 + *
65.79 + */
65.80 + public Image getIcon(int type) {
65.81 + return new ImageIcon(JBINode.class.getResource(IconConstants.JBI_ICON)).getImage();
65.82 + }
65.83 +
65.84 + // For now, use the same open for open/closed state
65.85 + public Image getOpenedIcon(int type) {
65.86 + return getIcon(type);
65.87 + }
65.88 +
65.89 + /**
65.90 + * Return the SheetProperties to be displayed for this JVM.
65.91 + *
65.92 + * @return A java.util.Map containing all JVM properties.
65.93 + */
65.94 + protected Map getSheetProperties() {
65.95 + JBIFrameworkService frameworkService = getJBIFrameworkService();
65.96 + Map map = Utils.getIntrospectedPropertyMap(frameworkService, true);
65.97 + return map;
65.98 + }
65.99 +
65.100 + // FIXME
65.101 + public Attribute setSheetProperty(String attrName, Object value) {
65.102 + AppserverJBIMgmtController controller = getAppserverJBIMgmtController();
65.103 + controller.setJBIFrameworkServiceDefaultLogProperty((String)value);
65.104 +
65.105 + // Get the new value
65.106 + Object newValue = getDefaultLogPropertyValue();
65.107 + return new Attribute(attrName, newValue);
65.108 + }
65.109 +
65.110 + private String getDefaultLogPropertyValue() {
65.111 + JBIFrameworkService frameworkService = getJBIFrameworkService();
65.112 + return frameworkService.getDefaultLogPropertyValue();
65.113 + }
65.114 +
65.115 + private JBIFrameworkService getJBIFrameworkService() {
65.116 + AppserverJBIMgmtController controller = getAppserverJBIMgmtController();
65.117 + return controller.getJBIFrameworkService();
65.118 + }
65.119 +
65.120 + public HelpCtx getHelpCtx() {
65.121 + return new HelpCtx(JBINode.class);
65.122 + }
65.123 +}
66.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
66.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/JBIServiceAssembliesNode.java Fri Oct 20 12:37:37 2006 +0000
66.3 @@ -0,0 +1,202 @@
66.4 +/*
66.5 + * The contents of this file are subject to the terms of the Common Development
66.6 + * and Distribution License (the License). You may not use this file except in
66.7 + * compliance with the License.
66.8 + *
66.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
66.10 + * or http://www.netbeans.org/cddl.txt.
66.11 +
66.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
66.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
66.14 + * If applicable, add the following below the CDDL Header, with the fields
66.15 + * enclosed by brackets [] replaced by your own identifying information:
66.16 + * "Portions Copyrighted [year] [name of copyright owner]"
66.17 + *
66.18 + * The Original Software is NetBeans. The Initial Developer of the Original
66.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
66.20 + * Microsystems, Inc. All Rights Reserved.
66.21 + */
66.22 +
66.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
66.24 +
66.25 +import java.awt.Image;
66.26 +import java.io.File;
66.27 +import java.util.Map;
66.28 +import java.util.ResourceBundle;
66.29 +
66.30 +import javax.management.Attribute;
66.31 +import javax.swing.Action;
66.32 +import javax.swing.JFileChooser;
66.33 +import javax.swing.SwingUtilities;
66.34 +
66.35 +import org.netbeans.modules.j2ee.sun.bridge.apis.RefreshAction;
66.36 +import org.netbeans.modules.sun.manager.jbi.GenericConstants;
66.37 +import org.netbeans.modules.sun.manager.jbi.management.JBIMBeanTaskResultHandler;
66.38 +import org.netbeans.modules.sun.manager.jbi.util.ProgressUI;
66.39 +import org.netbeans.modules.sun.manager.jbi.actions.DeployAction;
66.40 +import org.netbeans.modules.sun.manager.jbi.management.AdministrationService;
66.41 +import org.netbeans.modules.sun.manager.jbi.util.AppserverJBIMgmtController;
66.42 +import org.netbeans.modules.sun.manager.jbi.util.NodeTypes;
66.43 +import org.netbeans.modules.sun.manager.jbi.util.Utils;
66.44 +import org.netbeans.modules.sun.manager.jbi.util.ZipFileFilter;
66.45 +import org.openide.util.NbBundle;
66.46 +import org.openide.util.actions.SystemAction;
66.47 +import org.openide.util.HelpCtx;
66.48 +
66.49 +/**
66.50 + * Container node for all JBI Service Assemblies.
66.51 + *
66.52 + * @author jqian
66.53 + */
66.54 +public class JBIServiceAssembliesNode extends AppserverJBIMgmtContainerNode
66.55 + implements Deployable {
66.56 +
66.57 + private static final String NODE_TYPE = NodeTypes.SERVICE_ASSEMBLIES;
66.58 +
66.59 + private static String lastInstallDir = null;
66.60 +
66.61 + private boolean busy;
66.62 +
66.63 +
66.64 + public JBIServiceAssembliesNode(final AppserverJBIMgmtController controller) {
66.65 + super(controller, NODE_TYPE);
66.66 +
66.67 + setDisplayName(NbBundle.getMessage(JBIServiceAssembliesNode.class, "SERVICE_ASSEMBLIES")); // NOI18N
66.68 + }
66.69 +
66.70 + /**
66.71 + * Return the actions associated with the menu drop down seen when
66.72 + * a user right-clicks on a node in the plugin.
66.73 + *
66.74 + * @param boolean true/false
66.75 + * @return An array of Action objects.
66.76 + */
66.77 + public Action[] getActions(boolean flag) {
66.78 + return new SystemAction[] {
66.79 + SystemAction.get(DeployAction.class),
66.80 + SystemAction.get(RefreshAction.class),
66.81 + };
66.82 + }
66.83 +
66.84 + /**
66.85 + *
66.86 + */
66.87 + public Image getIcon(int type) {
66.88 + String iconName = IconConstants.FOLDER_ICON;
66.89 + String badgeIconName = IconConstants.SERVICE_ASSEMBLIES_BADGE_ICON;
66.90 + String externalBadgeIconName = busy ? IconConstants.BUSY_ICON : null;
66.91 + return Utils.getBadgedIcon(getClass(), iconName, badgeIconName, externalBadgeIconName);
66.92 + }
66.93 +
66.94 + /**
66.95 + *
66.96 + */
66.97 + public Image getOpenedIcon(int type) {
66.98 + return getIcon(type);
66.99 + }
66.100 +
66.101 + /**
66.102 + *
66.103 + * @param busy
66.104 + */
66.105 + private void setBusy(boolean busy) {
66.106 + this.busy = busy;
66.107 + fireIconChange();
66.108 + }
66.109 +
66.110 +
66.111 + /**
66.112 + * Deploys new Service Assemblies.
66.113 + */
66.114 + public void deploy() {
66.115 +
66.116 + AdministrationService adminService =
66.117 + getAppserverJBIMgmtController().getJBIAdministrationService();
66.118 +
66.119 + if (adminService != null) {
66.120 +
66.121 + JFileChooser chooser = getJFileChooser();
66.122 +
66.123 + int returnValue = chooser.showDialog(null,
66.124 + NbBundle.getMessage(JBIServiceAssembliesNode.class, "LBL_Deploy_Service_Assembly_Button")); //NOI18N
66.125 +
66.126 + if (returnValue == JFileChooser.APPROVE_OPTION){
66.127 + File[] selectedFiles = chooser.getSelectedFiles();
66.128 +
66.129 + String message =
66.130 + NbBundle.getMessage(JBIServiceAssembliesNode.class, "LBL_Deploying_Service_Assembly"); // NOI18N
66.131 + final ProgressUI progressUI = new ProgressUI(message, false);
66.132 +
66.133 + SwingUtilities.invokeLater(new Runnable() {
66.134 + public void run() {
66.135 + setBusy(true);
66.136 + progressUI.start();
66.137 + }
66.138 + });
66.139 +
66.140 + for (int i = 0; i < selectedFiles.length; i++) {
66.141 + final String zipFilePath = selectedFiles[i].getAbsolutePath();
66.142 + final String result = adminService.deployServiceAssembly(zipFilePath);
66.143 +
66.144 + SwingUtilities.invokeLater(new Runnable() {
66.145 + public void run() {
66.146 + JBIMBeanTaskResultHandler.showRemoteInvokationResult(
66.147 + GenericConstants.DEPLOY_SERVICE_ASSEMBLY_OPERATION_NAME,
66.148 + zipFilePath, result);
66.149 + }
66.150 + });
66.151 +
66.152 + if (i == 0) {
66.153 + lastInstallDir = selectedFiles[0].getParent();
66.154 + }
66.155 + }
66.156 +
66.157 + SwingUtilities.invokeLater(new Runnable() {
66.158 + public void run() {
66.159 + progressUI.finish();
66.160 + setBusy(false);
66.161 + }
66.162 + });
66.163 + }
66.164 + }
66.165 + }
66.166 +
66.167 + protected Map getSheetProperties() {
66.168 + return null;
66.169 + }
66.170 +
66.171 + public Attribute setSheetProperty(String attrName, Object value) {
66.172 + return null;
66.173 + }
66.174 +
66.175 + private JFileChooser getJFileChooser(){
66.176 + JFileChooser chooser = new JFileChooser();
66.177 +
66.178 + ResourceBundle bundle = NbBundle.getBundle(JBIComponentContainerNode.class);
66.179 +
66.180 + chooser.setDialogTitle(
66.181 + bundle.getString("LBL_Deploy_Service_Assembly_Chooser_Name")); //NOI18N
66.182 + chooser.setDialogType(JFileChooser.CUSTOM_DIALOG);
66.183 + chooser.setApproveButtonMnemonic(
66.184 + bundle.getString("Deploy_Service_Assembly_Button_Mnemonic").charAt(0)); //NOI18N
66.185 + chooser.setMultiSelectionEnabled(true);
66.186 + chooser.addChoosableFileFilter(ZipFileFilter.getInstance());
66.187 + chooser.setAcceptAllFileFilterUsed(false);
66.188 + chooser.setApproveButtonToolTipText(
66.189 + bundle.getString("LBL_Deploy_Service_Assembly_Button")); //NOI18N
66.190 + chooser.getAccessibleContext().setAccessibleName(
66.191 + bundle.getString("LBL_Deploy_Service_Assembly_Chooser_Name")); //NOI18N
66.192 + chooser.getAccessibleContext().setAccessibleDescription(
66.193 + bundle.getString("LBL_Deploy_Service_Assembly_Chooser_Name")); //NOI18N
66.194 +
66.195 + if (lastInstallDir != null) {
66.196 + chooser.setCurrentDirectory(new File(lastInstallDir));
66.197 + }
66.198 +
66.199 + return chooser;
66.200 + }
66.201 +
66.202 + public HelpCtx getHelpCtx() {
66.203 + return new HelpCtx(JBIServiceAssembliesNode.class);
66.204 + }
66.205 +}
67.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
67.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/JBIServiceAssemblyNode.java Fri Oct 20 12:37:37 2006 +0000
67.3 @@ -0,0 +1,426 @@
67.4 +/*
67.5 + * The contents of this file are subject to the terms of the Common Development
67.6 + * and Distribution License (the License). You may not use this file except in
67.7 + * compliance with the License.
67.8 + *
67.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
67.10 + * or http://www.netbeans.org/cddl.txt.
67.11 +
67.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
67.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
67.14 + * If applicable, add the following below the CDDL Header, with the fields
67.15 + * enclosed by brackets [] replaced by your own identifying information:
67.16 + * "Portions Copyrighted [year] [name of copyright owner]"
67.17 + *
67.18 + * The Original Software is NetBeans. The Initial Developer of the Original
67.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
67.20 + * Microsystems, Inc. All Rights Reserved.
67.21 + */
67.22 +
67.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
67.24 +
67.25 +import java.awt.Image;
67.26 +import java.util.Iterator;
67.27 +import java.util.List;
67.28 +import java.util.Map;
67.29 +
67.30 +import javax.management.Attribute;
67.31 +import javax.swing.Action;
67.32 +import javax.swing.SwingUtilities;
67.33 +import org.netbeans.modules.sun.manager.jbi.GenericConstants;
67.34 +import org.netbeans.modules.sun.manager.jbi.management.JBIMBeanTaskResultHandler;
67.35 +
67.36 +import org.netbeans.modules.sun.manager.jbi.util.ProgressUI;
67.37 +import org.netbeans.modules.sun.manager.jbi.actions.ShutdownAction;
67.38 +import org.netbeans.modules.sun.manager.jbi.actions.StartAction;
67.39 +import org.netbeans.modules.sun.manager.jbi.actions.StopAction;
67.40 +import org.netbeans.modules.sun.manager.jbi.actions.UndeployAction;
67.41 +import org.netbeans.modules.sun.manager.jbi.management.AdministrationService;
67.42 +import org.netbeans.modules.sun.manager.jbi.management.model.JBIComponentStatus;
67.43 +import org.netbeans.modules.sun.manager.jbi.management.model.JBIServiceAssemblyStatus;
67.44 +import org.netbeans.modules.sun.manager.jbi.management.model.JBIServiceUnitStatus;
67.45 +import org.netbeans.modules.sun.manager.jbi.util.AppserverJBIMgmtController;
67.46 +import org.netbeans.modules.sun.manager.jbi.util.NodeTypes;
67.47 +import org.netbeans.modules.sun.manager.jbi.util.Utils;
67.48 +import org.openide.nodes.Sheet;
67.49 +import org.openide.actions.PropertiesAction;
67.50 +import org.openide.util.NbBundle;
67.51 +import org.openide.util.actions.SystemAction;
67.52 +
67.53 +/**
67.54 + * Node for one JBI Service Assembly.
67.55 + *
67.56 + * @author jqian
67.57 + */
67.58 +public class JBIServiceAssemblyNode extends AppserverJBIMgmtContainerNode
67.59 + implements Startable, Stoppable, Shutdownable, Undeployable {
67.60 +
67.61 + private boolean busy;
67.62 +
67.63 + private JBIServiceAssemblyStatus cachedAssemblyStatus;
67.64 +
67.65 + /** Creates a new instance of ServiceAssemblyNode */
67.66 + public JBIServiceAssemblyNode(final AppserverJBIMgmtController controller,
67.67 + final String name,
67.68 + final String description) {
67.69 + super(controller, NodeTypes.SERVICE_ASSEMBLY);
67.70 + setName(name);
67.71 + setDisplayName(name);
67.72 + setShortDescription(description);
67.73 + }
67.74 +
67.75 + public JBIServiceAssemblyStatus getAssembly() {
67.76 + return getAssembly(false); // non-cached by default
67.77 + }
67.78 +
67.79 + private JBIServiceAssemblyStatus getAssembly(boolean cached) {
67.80 + if (cachedAssemblyStatus == null || !cached) {
67.81 + cachedAssemblyStatus =
67.82 + getAppserverJBIMgmtController().getJBIServiceAssemblyStatus(getName());
67.83 + }
67.84 +
67.85 + return cachedAssemblyStatus;
67.86 + }
67.87 +
67.88 + /**
67.89 + *
67.90 + */
67.91 + public Image getIcon(int type) {
67.92 +
67.93 + String baseIconName = IconConstants.SERVICE_ASSEMBLY_ICON;
67.94 +
67.95 + String status = getAssemblyStatus(false);
67.96 +
67.97 + String externalBadgeIconName = null;
67.98 + if (busy) {
67.99 + externalBadgeIconName = IconConstants.BUSY_ICON;
67.100 + } else {
67.101 + if (JBIComponentStatus.INSTALLED_STATE.equals(status)) {
67.102 + externalBadgeIconName = IconConstants.INSTALLED_ICON;
67.103 + } else if (JBIComponentStatus.STOPPED_STATE.equals(status)) {
67.104 + externalBadgeIconName = IconConstants.STOPPED_ICON;
67.105 + } else if (!JBIComponentStatus.STARTED_STATE.equals(status)) {
67.106 + externalBadgeIconName = IconConstants.UNKNOWN_ICON;
67.107 + }
67.108 + }
67.109 +
67.110 + return Utils.getBadgedIcon(getClass(), baseIconName, null, externalBadgeIconName);
67.111 + }
67.112 +
67.113 + // For now, use the same open for open/closed state
67.114 + public Image getOpenedIcon(int type) {
67.115 + return getIcon(type);
67.116 + }
67.117 +
67.118 + /**
67.119 + * Return the actions associated with the menu drop down seen when
67.120 + * a user right-clicks on a node in the plugin.
67.121 + *
67.122 + * @param boolean true/false
67.123 + * @return An array of Action objects.
67.124 + */
67.125 + public Action[] getActions(boolean flag) {
67.126 + return new SystemAction[] {
67.127 + SystemAction.get(StartAction.class),
67.128 + SystemAction.get(StopAction.class),
67.129 + SystemAction.get(ShutdownAction.class),
67.130 + SystemAction.get(UndeployAction.class),
67.131 + null,
67.132 + SystemAction.get(PropertiesAction.class),
67.133 + };
67.134 + }
67.135 +
67.136 + /**
67.137 + * Return the SheetProperties to be displayed for this JVM.
67.138 + *
67.139 + * @return A java.util.Map containing all JVM properties.
67.140 + */
67.141 + protected Map getSheetProperties() {
67.142 + JBIServiceAssemblyStatus assemblyStatus =
67.143 + getAppserverJBIMgmtController().getJBIServiceAssemblyStatus(getName());
67.144 + Map map = Utils.getIntrospectedPropertyMap(assemblyStatus, true);
67.145 + return map;
67.146 + }
67.147 +
67.148 + public Attribute setSheetProperty(String attrName, Object value) {
67.149 + return null;
67.150 + }
67.151 +
67.152 + /**
67.153 + *
67.154 + * @param busy
67.155 + */
67.156 + private void setBusy(boolean busy) {
67.157 + this.busy = busy;
67.158 + fireIconChange();
67.159 + }
67.160 +
67.161 + private String getAssemblyStatus(boolean cached) {
67.162 + JBIServiceAssemblyStatus assembly = getAssembly(cached);
67.163 + if (assembly != null) {
67.164 + return assembly.getStatus();
67.165 + } else {
67.166 + return null;
67.167 + }
67.168 + }
67.169 +
67.170 + private void updatePropertySheet() {
67.171 + Sheet sheet = createSheet();
67.172 + setSheet(sheet);
67.173 + firePropertySetsChange(null, null);
67.174 + }
67.175 +
67.176 + private AdministrationService getAdminService() {
67.177 + return getAppserverJBIMgmtController().getJBIAdministrationService();
67.178 + }
67.179 +
67.180 + //========================== Startable =====================================
67.181 +
67.182 + public boolean canStart() {
67.183 +// String status = getAssemblyStatus();
67.184 +// return !busy &&
67.185 +// (JBIServiceAssemblyStatus.STOP_STATUS.equals(status) ||
67.186 +// JBIServiceAssemblyStatus.SHUTDOWN_STATUS.equals(status));
67.187 +
67.188 + boolean ret = false;
67.189 +
67.190 + if (!busy) {
67.191 + JBIServiceAssemblyStatus assembly = getAssembly(false);
67.192 + String assemblyStatus = (assembly != null) ? assembly.getStatus() : null;
67.193 +
67.194 + if (JBIServiceAssemblyStatus.STOP_STATUS.equals(assemblyStatus)) {
67.195 + ret = true;
67.196 + } else if (JBIServiceAssemblyStatus.SHUTDOWN_STATUS.equals(assemblyStatus)) {
67.197 + ret = true;
67.198 + } else if (JBIServiceAssemblyStatus.START_STATUS.equals(assemblyStatus)) {
67.199 + List units = assembly.getJbiServiceUnitStatusList();
67.200 + if (units != null) {
67.201 + for (Iterator it = units.iterator(); it.hasNext();) {
67.202 + JBIServiceUnitStatus unit = (JBIServiceUnitStatus) it.next();
67.203 + String unitStatus = unit.getStatus();
67.204 + if (JBIServiceAssemblyStatus.STOP_STATUS.equals(unitStatus) ||
67.205 + JBIServiceAssemblyStatus.SHUTDOWN_STATUS.equals(unitStatus)) {
67.206 + ret = true;
67.207 + break;
67.208 + }
67.209 + }
67.210 + }
67.211 + }
67.212 + }
67.213 +
67.214 + return ret;
67.215 + }
67.216 +
67.217 +
67.218 + public void start() {
67.219 + AdministrationService adminService = getAdminService();
67.220 +
67.221 + if (adminService != null) {
67.222 + final String assemblyName = getName();
67.223 +
67.224 + String title =
67.225 + NbBundle.getMessage(JBIServiceAssemblyNode.class,
67.226 + "LBL_Starting_Service_Assembly", // NOI18N
67.227 + new Object[] {assemblyName});
67.228 + final ProgressUI progressUI = new ProgressUI(title, false);
67.229 +
67.230 + SwingUtilities.invokeLater(new Runnable() {
67.231 + public void run() {
67.232 + setBusy(true);
67.233 + progressUI.start();
67.234 + }
67.235 + });
67.236 +
67.237 + final String result = adminService.startServiceAssembly(assemblyName);
67.238 +
67.239 + SwingUtilities.invokeLater(new Runnable() {
67.240 + public void run() {
67.241 + progressUI.finish();
67.242 + JBIMBeanTaskResultHandler.showRemoteInvokationResult(
67.243 + GenericConstants.START_SERVICE_ASSEMBLY_OPERATION_NAME,
67.244 + assemblyName, result);
67.245 + setBusy(false);
67.246 + }
67.247 + });
67.248 +
67.249 + updatePropertySheet();
67.250 + }
67.251 + }
67.252 +
67.253 + //========================== Stoppable =====================================
67.254 +
67.255 + public boolean canStop() {
67.256 +// return !busy && JBIServiceAssemblyStatus.START_STATUS.equals(getAssemblyStatus());
67.257 +
67.258 + boolean ret = false;
67.259 +
67.260 + if (!busy) {
67.261 + JBIServiceAssemblyStatus assembly = getAssembly(true); // cached
67.262 + String assemblyStatus = (assembly != null) ? assembly.getStatus() : null;
67.263 +
67.264 + if (JBIServiceAssemblyStatus.START_STATUS.equals(assemblyStatus)) {
67.265 + ret = true;
67.266 + } else if (JBIServiceAssemblyStatus.STOP_STATUS.equals(assemblyStatus)) {
67.267 + List units = assembly.getJbiServiceUnitStatusList();
67.268 + if (units != null) {
67.269 + for (Iterator it = units.iterator(); it.hasNext();) {
67.270 + JBIServiceUnitStatus unit = (JBIServiceUnitStatus) it.next();
67.271 + String unitStatus = unit.getStatus();
67.272 + if (JBIServiceAssemblyStatus.START_STATUS.equals(unitStatus)) {
67.273 + ret = true;
67.274 + break;
67.275 + }
67.276 + }
67.277 + }
67.278 + }
67.279 + }
67.280 +
67.281 + return ret;
67.282 + }
67.283 +
67.284 + public void stop() {
67.285 + AdministrationService adminService = getAdminService();
67.286 +
67.287 + if (adminService != null) {
67.288 + final String assemblyName = getName();
67.289 +
67.290 + String title =
67.291 + NbBundle.getMessage(JBIServiceAssemblyNode.class,
67.292 + "LBL_Stopping_Service_Assembly", // NOI18N
67.293 + new Object[] {assemblyName});
67.294 + final ProgressUI progressUI = new ProgressUI(title, false);
67.295 +
67.296 + SwingUtilities.invokeLater(new Runnable() {
67.297 + public void run() {
67.298 + setBusy(true);
67.299 + progressUI.start();
67.300 + }
67.301 + });
67.302 +
67.303 + final String result = adminService.stopServiceAssembly(assemblyName);
67.304 +
67.305 + SwingUtilities.invokeLater(new Runnable() {
67.306 + public void run() {
67.307 + progressUI.finish();
67.308 + JBIMBeanTaskResultHandler.showRemoteInvokationResult(
67.309 + GenericConstants.STOP_SERVICE_ASSEMBLY_OPERATION_NAME,
67.310 + assemblyName, result);
67.311 + setBusy(false);
67.312 + }
67.313 + });
67.314 +
67.315 + updatePropertySheet();
67.316 + }
67.317 + }
67.318 +
67.319 + //========================== Shutdownable ==================================
67.320 +
67.321 + public boolean canShutdown() {
67.322 +// return !busy && JBIServiceAssemblyStatus.STOP_STATUS.equals(getAssemblyStatus());
67.323 +
67.324 + boolean ret = false;
67.325 +
67.326 + if (!busy) {
67.327 + JBIServiceAssemblyStatus assembly = getAssembly(true); // cached
67.328 + String assemblyStatus = (assembly != null) ? assembly.getStatus() : null;
67.329 +
67.330 + if (JBIServiceAssemblyStatus.STOP_STATUS.equals(assemblyStatus)) {
67.331 + ret = true;
67.332 + } else if (JBIServiceAssemblyStatus.SHUTDOWN_STATUS.equals(assemblyStatus)) {
67.333 + List units = assembly.getJbiServiceUnitStatusList();
67.334 + if (units != null) {
67.335 + for (Iterator it = units.iterator(); it.hasNext();) {
67.336 + JBIServiceUnitStatus unit = (JBIServiceUnitStatus) it.next();
67.337 + String unitStatus = unit.getStatus();
67.338 + if (JBIServiceAssemblyStatus.START_STATUS.equals(unitStatus) ||
67.339 + JBIServiceAssemblyStatus.STOP_STATUS.equals(unitStatus)) {
67.340 + ret = true;
67.341 + break;
67.342 + }
67.343 + }
67.344 + }
67.345 + }
67.346 + }
67.347 +
67.348 + return ret;
67.349 + }
67.350 +
67.351 + public void shutdown() {
67.352 + AdministrationService adminService = getAdminService();
67.353 +
67.354 + if (adminService != null) {
67.355 + final String assemblyName = getName();
67.356 +
67.357 + String title =
67.358 + NbBundle.getMessage(JBIServiceAssemblyNode.class,
67.359 + "LBL_Shutting_Down_Service_Assembly", // NOI18N
67.360 + new Object[] {assemblyName});
67.361 + final ProgressUI progressUI = new ProgressUI(title, false);
67.362 +
67.363 + SwingUtilities.invokeLater(new Runnable() {
67.364 + public void run() {
67.365 + setBusy(true);
67.366 + progressUI.start();
67.367 + }
67.368 + });
67.369 +
67.370 + final String result =
67.371 + adminService.shutdownServiceAssembly(assemblyName);
67.372 +
67.373 + SwingUtilities.invokeLater(new Runnable() {
67.374 + public void run() {
67.375 + progressUI.finish();
67.376 + JBIMBeanTaskResultHandler.showRemoteInvokationResult(
67.377 + GenericConstants.SHUTDOWN_SERVICE_ASSEMBLY_OPERATION_NAME,
67.378 + assemblyName, result);
67.379 + setBusy(false);
67.380 + }
67.381 + });
67.382 +
67.383 + updatePropertySheet();
67.384 + }
67.385 + }
67.386 +
67.387 + //========================== Undeployable =================================
67.388 +
67.389 + public boolean canUndeploy() {
67.390 + String assemblyStatus = getAssemblyStatus(true); // cached
67.391 + return !busy && JBIServiceAssemblyStatus.SHUTDOWN_STATUS.equals(assemblyStatus);
67.392 + }
67.393 +
67.394 + public void undeploy() {
67.395 + AdministrationService adminService = getAdminService();
67.396 +
67.397 + if (adminService != null) {
67.398 + final String assemblyName = getName();
67.399 +
67.400 + String title =
67.401 + NbBundle.getMessage(JBIServiceAssemblyNode.class,
67.402 + "LBL_Undeploying_Service_Assembly", // NOI18N
67.403 + new Object[] {assemblyName});
67.404 + final ProgressUI progressUI = new ProgressUI(title, false);
67.405 +
67.406 + SwingUtilities.invokeLater(new Runnable() {
67.407 + public void run() {
67.408 + setBusy(true);
67.409 + progressUI.start();
67.410 + }
67.411 + });
67.412 +
67.413 + final String result =
67.414 + adminService.undeployServiceAssembly(assemblyName);
67.415 +
67.416 + SwingUtilities.invokeLater(new Runnable() {
67.417 + public void run() {
67.418 + progressUI.finish();
67.419 + JBIMBeanTaskResultHandler.showRemoteInvokationResult(
67.420 + GenericConstants.UNDEPLOY_SERVICE_ASSEMBLY_OPERATION_NAME,
67.421 + assemblyName, result);
67.422 + setBusy(false);
67.423 + }
67.424 + });
67.425 +
67.426 + updatePropertySheet();
67.427 + }
67.428 + }
67.429 +}
68.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
68.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/JBIServiceUnitNode.java Fri Oct 20 12:37:37 2006 +0000
68.3 @@ -0,0 +1,101 @@
68.4 +/*
68.5 + * The contents of this file are subject to the terms of the Common Development
68.6 + * and Distribution License (the License). You may not use this file except in
68.7 + * compliance with the License.
68.8 + *
68.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
68.10 + * or http://www.netbeans.org/cddl.txt.
68.11 +
68.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
68.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
68.14 + * If applicable, add the following below the CDDL Header, with the fields
68.15 + * enclosed by brackets [] replaced by your own identifying information:
68.16 + * "Portions Copyrighted [year] [name of copyright owner]"
68.17 + *
68.18 + * The Original Software is NetBeans. The Initial Developer of the Original
68.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
68.20 + * Microsystems, Inc. All Rights Reserved.
68.21 + */
68.22 +
68.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
68.24 +
68.25 +import java.awt.Image;
68.26 +import java.util.Map;
68.27 +
68.28 +import javax.management.Attribute;
68.29 +
68.30 +import org.netbeans.modules.sun.manager.jbi.management.model.JBIComponentStatus;
68.31 +import org.netbeans.modules.sun.manager.jbi.management.model.JBIServiceUnitStatus;
68.32 +import org.netbeans.modules.sun.manager.jbi.util.AppserverJBIMgmtController;
68.33 +import org.netbeans.modules.sun.manager.jbi.util.NodeTypes;
68.34 +import org.netbeans.modules.sun.manager.jbi.util.Utils;
68.35 +
68.36 +/**
68.37 + * Node for one JBI Service Unit.
68.38 + *
68.39 + * @author jqian
68.40 + */
68.41 +public class JBIServiceUnitNode extends AppserverJBIMgmtLeafNode {
68.42 +
68.43 + private static final String NODE_TYPE = NodeTypes.SERVICE_UNIT;
68.44 +
68.45 + public JBIServiceUnitNode(final AppserverJBIMgmtController controller,
68.46 + final String name,
68.47 + final String displayName,
68.48 + final String description) {
68.49 + super(controller, NODE_TYPE);
68.50 + setName(name);
68.51 + setDisplayName(displayName);
68.52 + setShortDescription(description);
68.53 + }
68.54 +
68.55 + /**
68.56 + * Return the SheetProperties to be displayed for this JVM.
68.57 + *
68.58 + * @return A java.util.Map containing all JVM properties.
68.59 + */
68.60 + protected Map getSheetProperties() {
68.61 + JBIServiceUnitStatus serviceUnit = getServiceUnitStatus();
68.62 + Map map = Utils.getIntrospectedPropertyMap(serviceUnit, true);
68.63 + return map;
68.64 + }
68.65 +
68.66 + /**
68.67 + *
68.68 + */
68.69 + public Attribute setSheetProperty(String attrName, Object value) {
68.70 + return null;
68.71 + }
68.72 +
68.73 + /**
68.74 + *
68.75 + * @return
68.76 + */
68.77 + private JBIServiceUnitStatus getServiceUnitStatus() {
68.78 + AppserverJBIMgmtController controller = getAppserverJBIMgmtController();
68.79 + String assemblyName = getParentNode().getName();
68.80 + return controller.getJBIServiceUnitStatus(assemblyName, getName());
68.81 + }
68.82 +
68.83 + /**
68.84 + *
68.85 + */
68.86 + public Image getIcon(int type) {
68.87 +
68.88 + String baseIconName = IconConstants.SERVICE_UNIT_ICON;
68.89 +
68.90 + JBIServiceUnitStatus unitStatus = getServiceUnitStatus();
68.91 + String status = (unitStatus == null) ? null : unitStatus.getStatus();
68.92 +
68.93 + String externalBadgeIconName = null;
68.94 + if (JBIComponentStatus.INSTALLED_STATE.equals(status)) {
68.95 + externalBadgeIconName = IconConstants.INSTALLED_ICON;
68.96 + } else if (JBIComponentStatus.STOPPED_STATE.equals(status)) {
68.97 + externalBadgeIconName = IconConstants.STOPPED_ICON;
68.98 + } else if (!JBIComponentStatus.STARTED_STATE.equals(status)) {
68.99 + externalBadgeIconName = IconConstants.UNKNOWN_ICON;
68.100 + }
68.101 +
68.102 + return Utils.getBadgedIcon(getClass(), baseIconName, null, externalBadgeIconName);
68.103 + }
68.104 +}
69.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
69.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/Shutdownable.java Fri Oct 20 12:37:37 2006 +0000
69.3 @@ -0,0 +1,38 @@
69.4 +/*
69.5 + * The contents of this file are subject to the terms of the Common Development
69.6 + * and Distribution License (the License). You may not use this file except in
69.7 + * compliance with the License.
69.8 + *
69.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
69.10 + * or http://www.netbeans.org/cddl.txt.
69.11 +
69.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
69.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
69.14 + * If applicable, add the following below the CDDL Header, with the fields
69.15 + * enclosed by brackets [] replaced by your own identifying information:
69.16 + * "Portions Copyrighted [year] [name of copyright owner]"
69.17 + *
69.18 + * The Original Software is NetBeans. The Initial Developer of the Original
69.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
69.20 + * Microsystems, Inc. All Rights Reserved.
69.21 + */
69.22 +
69.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
69.24 +
69.25 +
69.26 +/**
69.27 + *
69.28 + * @author jqian
69.29 + */
69.30 +public interface Shutdownable {
69.31 +
69.32 +
69.33 + /**
69.34 + *
69.35 + *
69.36 + */
69.37 + public void shutdown();
69.38 +
69.39 +
69.40 + public boolean canShutdown();
69.41 +}
70.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
70.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/Startable.java Fri Oct 20 12:37:37 2006 +0000
70.3 @@ -0,0 +1,39 @@
70.4 +/*
70.5 + * The contents of this file are subject to the terms of the Common Development
70.6 + * and Distribution License (the License). You may not use this file except in
70.7 + * compliance with the License.
70.8 + *
70.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
70.10 + * or http://www.netbeans.org/cddl.txt.
70.11 +
70.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
70.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
70.14 + * If applicable, add the following below the CDDL Header, with the fields
70.15 + * enclosed by brackets [] replaced by your own identifying information:
70.16 + * "Portions Copyrighted [year] [name of copyright owner]"
70.17 + *
70.18 + * The Original Software is NetBeans. The Initial Developer of the Original
70.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
70.20 + * Microsystems, Inc. All Rights Reserved.
70.21 + */
70.22 +
70.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
70.24 +
70.25 +
70.26 +/**
70.27 + *
70.28 + * @author jqian
70.29 + */
70.30 +public interface Startable {
70.31 +
70.32 +
70.33 + /**
70.34 + *
70.35 + *
70.36 + */
70.37 + public void start();
70.38 +
70.39 + public boolean canStart();
70.40 +
70.41 +
70.42 +}
71.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
71.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/Stoppable.java Fri Oct 20 12:37:37 2006 +0000
71.3 @@ -0,0 +1,38 @@
71.4 +/*
71.5 + * The contents of this file are subject to the terms of the Common Development
71.6 + * and Distribution License (the License). You may not use this file except in
71.7 + * compliance with the License.
71.8 + *
71.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
71.10 + * or http://www.netbeans.org/cddl.txt.
71.11 +
71.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
71.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
71.14 + * If applicable, add the following below the CDDL Header, with the fields
71.15 + * enclosed by brackets [] replaced by your own identifying information:
71.16 + * "Portions Copyrighted [year] [name of copyright owner]"
71.17 + *
71.18 + * The Original Software is NetBeans. The Initial Developer of the Original
71.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
71.20 + * Microsystems, Inc. All Rights Reserved.
71.21 + */
71.22 +
71.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
71.24 +
71.25 +
71.26 +/**
71.27 + *
71.28 + * @author jqian
71.29 + */
71.30 +public interface Stoppable {
71.31 +
71.32 +
71.33 + /**
71.34 + *
71.35 + *
71.36 + */
71.37 + public void stop();
71.38 +
71.39 +
71.40 + public boolean canStop();
71.41 +}
72.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
72.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/Undeployable.java Fri Oct 20 12:37:37 2006 +0000
72.3 @@ -0,0 +1,39 @@
72.4 +/*
72.5 + * The contents of this file are subject to the terms of the Common Development
72.6 + * and Distribution License (the License). You may not use this file except in
72.7 + * compliance with the License.
72.8 + *
72.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
72.10 + * or http://www.netbeans.org/cddl.txt.
72.11 +
72.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
72.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
72.14 + * If applicable, add the following below the CDDL Header, with the fields
72.15 + * enclosed by brackets [] replaced by your own identifying information:
72.16 + * "Portions Copyrighted [year] [name of copyright owner]"
72.17 + *
72.18 + * The Original Software is NetBeans. The Initial Developer of the Original
72.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
72.20 + * Microsystems, Inc. All Rights Reserved.
72.21 + */
72.22 +
72.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
72.24 +
72.25 +
72.26 +/**
72.27 + *
72.28 + * @author jqian
72.29 + */
72.30 +public interface Undeployable {
72.31 +
72.32 +
72.33 + /**
72.34 + *
72.35 + *
72.36 + */
72.37 + public void undeploy();
72.38 +
72.39 + public boolean canUndeploy();
72.40 +
72.41 +
72.42 +}
73.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
73.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/nodes/Uninstallable.java Fri Oct 20 12:37:37 2006 +0000
73.3 @@ -0,0 +1,37 @@
73.4 +/*
73.5 + * The contents of this file are subject to the terms of the Common Development
73.6 + * and Distribution License (the License). You may not use this file except in
73.7 + * compliance with the License.
73.8 + *
73.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
73.10 + * or http://www.netbeans.org/cddl.txt.
73.11 +
73.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
73.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
73.14 + * If applicable, add the following below the CDDL Header, with the fields
73.15 + * enclosed by brackets [] replaced by your own identifying information:
73.16 + * "Portions Copyrighted [year] [name of copyright owner]"
73.17 + *
73.18 + * The Original Software is NetBeans. The Initial Developer of the Original
73.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
73.20 + * Microsystems, Inc. All Rights Reserved.
73.21 + */
73.22 +
73.23 +package org.netbeans.modules.sun.manager.jbi.nodes;
73.24 +
73.25 +
73.26 +/**
73.27 + *
73.28 + * @author jqian
73.29 + */
73.30 +public interface Uninstallable {
73.31 +
73.32 +
73.33 + /**
73.34 + *
73.35 + *
73.36 + */
73.37 + public void uninstall();
73.38 +
73.39 + public boolean canUninstall();
73.40 +}
74.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
74.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/util/Bundle.properties Fri Oct 20 12:37:37 2006 +0000
74.3 @@ -0,0 +1,22 @@
74.4 +#
74.5 +# The contents of this file are subject to the terms of the Common Development
74.6 +# and Distribution License (the License). You may not use this file except in
74.7 +# compliance with the License.
74.8 +#
74.9 +# You can obtain a copy of the License at http://www.netbeans.org/cddl.html
74.10 +# or http://www.netbeans.org/cddl.txt.
74.11 +
74.12 +# When distributing Covered Code, include this CDDL Header Notice in each file
74.13 +# and include the License file at http://www.netbeans.org/cddl.txt.
74.14 +# If applicable, add the following below the CDDL Header, with the fields
74.15 +# enclosed by brackets [] replaced by your own identifying information:
74.16 +# "Portions Copyrighted [year] [name of copyright owner]"
74.17 +#
74.18 +# The Original Software is NetBeans. The Initial Developer of the Original
74.19 +# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
74.20 +# Microsystems, Inc. All Rights Reserved.
74.21 +#
74.22 +LBL_JARType=JAR files (*.jar)
74.23 +LBL_ZIPType=ZIP files (*.zip)
74.24 +
74.25 +LBL_JBI_Console=JBI Console
74.26 \ No newline at end of file
75.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
75.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/util/ComparableAttribute.java Fri Oct 20 12:37:37 2006 +0000
75.3 @@ -0,0 +1,39 @@
75.4 +/*
75.5 + * The contents of this file are subject to the terms of the Common Development
75.6 + * and Distribution License (the License). You may not use this file except in
75.7 + * compliance with the License.
75.8 + *
75.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
75.10 + * or http://www.netbeans.org/cddl.txt.
75.11 +
75.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
75.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
75.14 + * If applicable, add the following below the CDDL Header, with the fields
75.15 + * enclosed by brackets [] replaced by your own identifying information:
75.16 + * "Portions Copyrighted [year] [name of copyright owner]"
75.17 + *
75.18 + * The Original Software is NetBeans. The Initial Developer of the Original
75.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
75.20 + * Microsystems, Inc. All Rights Reserved.
75.21 + */
75.22 +
75.23 +package org.netbeans.modules.sun.manager.jbi.util;
75.24 +
75.25 +import javax.management.Attribute;
75.26 +
75.27 +public class ComparableAttribute extends Attribute implements Comparable {
75.28 +
75.29 + /** Creates a new instance of ComparableAttribute */
75.30 + public ComparableAttribute(Attribute attr) {
75.31 + super(attr.getName(), attr.getValue());
75.32 + }
75.33 +
75.34 + public int compareTo(Object another) {
75.35 + if (!(another instanceof Attribute)) {
75.36 + throw new ClassCastException("Wrong class: " + another.getClass().getName()); // NOI18N
75.37 + }
75.38 +
75.39 + Attribute anotherAttr = (Attribute) another;
75.40 + return getName().compareTo(anotherAttr.getName());
75.41 + }
75.42 +}
76.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
76.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/util/MBeanUtil.java Fri Oct 20 12:37:37 2006 +0000
76.3 @@ -0,0 +1,98 @@
76.4 +/*
76.5 + * The contents of this file are subject to the terms of the Common Development
76.6 + * and Distribution License (the License). You may not use this file except in
76.7 + * compliance with the License.
76.8 + *
76.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
76.10 + * or http://www.netbeans.org/cddl.txt.
76.11 +
76.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
76.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
76.14 + * If applicable, add the following below the CDDL Header, with the fields
76.15 + * enclosed by brackets [] replaced by your own identifying information:
76.16 + * "Portions Copyrighted [year] [name of copyright owner]"
76.17 + *
76.18 + * The Original Software is NetBeans. The Initial Developer of the Original
76.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
76.20 + * Microsystems, Inc. All Rights Reserved.
76.21 + */
76.22 +package org.netbeans.modules.sun.manager.jbi.util;
76.23 +
76.24 +import java.util.ArrayList;
76.25 +import java.util.Collection;
76.26 +import java.util.List;
76.27 +import java.util.Set;
76.28 +
76.29 +import javax.management.Attribute;
76.30 +import javax.management.AttributeList;
76.31 +import javax.management.MBeanAttributeInfo;
76.32 +import javax.management.MBeanInfo;
76.33 +import javax.management.MBeanServerConnection;
76.34 +import javax.management.ObjectName;
76.35 +
76.36 +public class MBeanUtil {
76.37 +
76.38 + public ObjectName[] getAllObjectNames(MBeanServerConnection connection) throws Exception {
76.39 + Set<ObjectName> set = (Set<ObjectName>) connection.queryNames(null, null);
76.40 + return (ObjectName[]) set.toArray(new ObjectName[0]);
76.41 + }
76.42 +
76.43 + public String[] getAttributeNames(MBeanServerConnection connection, ObjectName objectName) throws Exception {
76.44 + Collection<String> list = new ArrayList<String>();
76.45 + MBeanInfo info = connection.getMBeanInfo(objectName);
76.46 + MBeanAttributeInfo[] attributes = info.getAttributes();
76.47 + for (int i = 0; i < attributes.length; i++) {
76.48 + MBeanAttributeInfo attributeInfo = (MBeanAttributeInfo) attributes[i];
76.49 + String attributeName = attributeInfo.getName();
76.50 + list.add(attributeName);
76.51 + }
76.52 + return list.toArray(new String[0]);
76.53 + }
76.54 +
76.55 + public Object getAttributeValue(MBeanServerConnection connection, ObjectName objectName, String attributeName) throws Exception {
76.56 + return connection.getAttribute(objectName, attributeName);
76.57 + }
76.58 +
76.59 + public Object[] getAttributeValues(MBeanServerConnection connection, ObjectName name, String[] attributeNames) throws Exception {
76.60 + Collection<Object> list = new ArrayList<Object>();
76.61 + Attribute[] attributes = getAttributes(connection, name, attributeNames);
76.62 + for (int i = 0; i < attributes.length; i++) {
76.63 + Attribute attribute = attributes[i];
76.64 + list.add(attribute.getValue());
76.65 + }
76.66 + return list.toArray(new Object[0]);
76.67 + }
76.68 +
76.69 + public Attribute[] getAttributes(MBeanServerConnection connection, ObjectName objectName, String[] attributeNames) throws Exception {
76.70 + List<Attribute> list = (List<Attribute>) connection.getAttributes(objectName, attributeNames);
76.71 + return (Attribute[]) list.toArray(new Attribute[0]);
76.72 + }
76.73 +
76.74 + public void print(MBeanServerConnection connection) throws Exception {
76.75 + print(connection, null, null, null);
76.76 + }
76.77 +
76.78 + public void print(MBeanServerConnection connection, String objectNameFilter, String attributeNameFilter, String attributeValueFilter) throws Exception {
76.79 + ObjectName[] objectNames = getAllObjectNames(connection);
76.80 + for (int i = 0; i < objectNames.length; i++) {
76.81 + ObjectName objectName = objectNames[i];
76.82 + if (objectNameFilter == null || String.valueOf(objectName).indexOf(objectNameFilter)!=-1) {
76.83 + String[] attributeNames = getAttributeNames(connection, objectName);
76.84 + for (int j = 0; j < attributeNames.length; j++) {
76.85 + String attributeName = attributeNames[j];
76.86 + if (attributeNameFilter == null || attributeName.indexOf(attributeNameFilter)!=-1) {
76.87 + Object attributeValue;
76.88 + try {
76.89 + attributeValue = getAttributeValue(connection, objectName, attributeName);
76.90 + } catch (Exception e) {
76.91 + attributeValue = e.getMessage();
76.92 + }
76.93 + if (attributeValueFilter == null || String.valueOf(attributeValue).indexOf(attributeValueFilter)!=-1) {
76.94 + System.out.println("objectName: " + objectName + " attributeName: " + attributeName + " attributeValue: " + attributeValue); // NOI18N
76.95 + }
76.96 + }
76.97 + }
76.98 + }
76.99 + }
76.100 + }
76.101 +}
77.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
77.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/util/ProgressUI.java Fri Oct 20 12:37:37 2006 +0000
77.3 @@ -0,0 +1,228 @@
77.4 +/*
77.5 + * The contents of this file are subject to the terms of the Common Development
77.6 + * and Distribution License (the License). You may not use this file except in
77.7 + * compliance with the License.
77.8 + *
77.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
77.10 + * or http://www.netbeans.org/cddl.txt.
77.11 +
77.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
77.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
77.14 + * If applicable, add the following below the CDDL Header, with the fields
77.15 + * enclosed by brackets [] replaced by your own identifying information:
77.16 + * "Portions Copyrighted [year] [name of copyright owner]"
77.17 + *
77.18 + * The Original Software is NetBeans. The Initial Developer of the Original
77.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
77.20 + * Microsystems, Inc. All Rights Reserved.
77.21 + */
77.22 +
77.23 +package org.netbeans.modules.sun.manager.jbi.util;
77.24 +
77.25 +import java.awt.GridBagConstraints;
77.26 +import java.awt.Insets;
77.27 +import java.awt.event.ActionEvent;
77.28 +import java.awt.event.ActionListener;
77.29 +
77.30 +import javax.enterprise.deploy.shared.StateType;
77.31 +import javax.enterprise.deploy.spi.status.DeploymentStatus;
77.32 +import javax.enterprise.deploy.spi.status.ProgressEvent;
77.33 +import javax.enterprise.deploy.spi.status.ProgressListener;
77.34 +import javax.enterprise.deploy.spi.status.ProgressObject;
77.35 +import javax.swing.JButton;
77.36 +import javax.swing.JComponent;
77.37 +import javax.swing.JDialog;
77.38 +import javax.swing.JLabel;
77.39 +import javax.swing.JPanel;
77.40 +
77.41 +import org.netbeans.api.progress.ProgressHandle;
77.42 +import org.netbeans.api.progress.ProgressHandleFactory;
77.43 +import org.netbeans.modules.sun.manager.jbi.util.Utils;
77.44 +import org.openide.util.NbBundle;
77.45 +//import org.openide.util.Utilities;
77.46 +//import org.openide.windows.WindowManager;
77.47 +
77.48 +
77.49 +/**
77.50 + * Progress UI provides a feedback for long lasting taks like deploying to a server,
77.51 + * starting or stopping a server, etc. The progress bar is indeterminate, displayed
77.52 + * in the status bar if in non-modal mode, otherwise in a modal dialog.
77.53 + *
77.54 + * @author sherold
77.55 + */
77.56 +public class ProgressUI implements ProgressListener {
77.57 +
77.58 + private String title;
77.59 + private boolean modal;
77.60 +// private Deployment.Logger logger;
77.61 +
77.62 + private ProgressHandle handle;
77.63 + private ProgressObject progObj;
77.64 +
77.65 + private JDialog dialog;
77.66 + private JLabel messageLabel;
77.67 + private String lastMessage;
77.68 + private JComponent progressComponent;
77.69 + private boolean finished;
77.70 +
77.71 + /** Creates a new instance of ProgressUI */
77.72 + public ProgressUI(String title, boolean modal) {
77.73 +// this(title, modal, null);
77.74 +// }
77.75 +//
77.76 +// public ProgressUI(String title, boolean modal, Deployment.Logger logger) {
77.77 + this.modal = modal;
77.78 + this.title = title;
77.79 +// this.logger = logger;
77.80 + handle = ProgressHandleFactory.createHandle(title);
77.81 + }
77.82 +
77.83 + /** Start the progress indication for indeterminate task. */
77.84 + public void start() {
77.85 + if (modal) {
77.86 + progressComponent = ProgressHandleFactory.createProgressComponent(handle);
77.87 + }
77.88 + handle.start();
77.89 + }
77.90 +
77.91 + /** Display the modal progress dialog. This method should be called from the
77.92 + AWT Event Dispatch thread. */
77.93 +// public void showProgressDialog() {
77.94 +// if (finished) {
77.95 +// return; // do not display the dialog if we are done
77.96 +// }
77.97 +// dialog = new JDialog(WindowManager.getDefault().getMainWindow(), title, true);
77.98 +// dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
77.99 +// dialog.getContentPane().add(createProgressDialog(
77.100 +// handle,
77.101 +// lastMessage != null ? lastMessage : title));
77.102 +// dialog.pack();
77.103 +// dialog.setBounds(Utilities.findCenterBounds(dialog.getSize()));
77.104 +// dialog.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
77.105 +// dialog.setVisible(true);
77.106 +// }
77.107 +
77.108 + /** Displays a specified progress message. */
77.109 + public void progress(final String message) {
77.110 + handle.progress(message);
77.111 + if (modal) {
77.112 + Utils.runInEventDispatchThread(new Runnable() {
77.113 + public void run() {
77.114 + if (messageLabel != null) {
77.115 + messageLabel.setText(message);
77.116 + } else {
77.117 + lastMessage = message;
77.118 + }
77.119 + }
77.120 + });
77.121 + }
77.122 +// log(message);
77.123 + }
77.124 +
77.125 + /** Finish the task, unregister the progress object listener and dispose the ui. */
77.126 + public void finish() {
77.127 + handle.finish();
77.128 + if (progObj != null) {
77.129 + progObj.removeProgressListener(this);
77.130 + progObj = null;
77.131 + }
77.132 + Utils.runInEventDispatchThread(new Runnable() {
77.133 + public void run() {
77.134 + finished = true;
77.135 + if (dialog != null) {
77.136 + dialog.setVisible(false);
77.137 + dialog.dispose();
77.138 + dialog = null;
77.139 + }
77.140 + }
77.141 + });
77.142 + }
77.143 +
77.144 + /** Display a failure dialog with the specified message and call finish. */
77.145 + public void failed(String message) {
77.146 + finish();
77.147 +// if (logger != null) {
77.148 +// log(message);
77.149 +// }
77.150 + }
77.151 +
77.152 + /** Set a progress object this progress UI will monitor. */
77.153 + public void setProgressObject(ProgressObject obj) {
77.154 + // do not listen to the old progress object anymore
77.155 + if (progObj != null) {
77.156 + progObj.removeProgressListener(this);
77.157 + }
77.158 + progObj = obj;
77.159 + if (progObj != null) {
77.160 + progObj.addProgressListener(this);
77.161 + }
77.162 + }
77.163 +
77.164 +// /** Set a logger to where all the progress messages will be copied. */
77.165 +// public void setLogger(Deployment.Logger logger) {
77.166 +// this.logger = logger;
77.167 +// }
77.168 +//
77.169 +// // private helper methods
77.170 +//
77.171 +// private void log(String msg) {
77.172 +// if (logger != null && msg != null) {
77.173 +// logger.log(msg);
77.174 +// }
77.175 +// }
77.176 +
77.177 + private JComponent createProgressDialog(ProgressHandle handle, String message) {
77.178 + JPanel panel = new JPanel();
77.179 + messageLabel = new JLabel();
77.180 +
77.181 + panel.setLayout(new java.awt.GridBagLayout());
77.182 +
77.183 + messageLabel.setText(message);
77.184 + GridBagConstraints gridBagConstraints = new GridBagConstraints();
77.185 + gridBagConstraints.anchor = GridBagConstraints.NORTHWEST;
77.186 + gridBagConstraints.insets = new Insets(12, 12, 0, 12);
77.187 + panel.add(messageLabel, gridBagConstraints);
77.188 +
77.189 + gridBagConstraints = new GridBagConstraints();
77.190 + gridBagConstraints.gridx = 0;
77.191 + gridBagConstraints.gridy = 1;
77.192 + gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
77.193 + gridBagConstraints.anchor = GridBagConstraints.NORTHWEST;
77.194 + gridBagConstraints.weightx = 1.0;
77.195 + gridBagConstraints.insets = new Insets(5, 12, 0, 12);
77.196 + panel.add(progressComponent, gridBagConstraints);
77.197 +
77.198 + gridBagConstraints = new GridBagConstraints();
77.199 + gridBagConstraints.gridx = 0;
77.200 + gridBagConstraints.gridy = 2;
77.201 + gridBagConstraints.anchor = GridBagConstraints.CENTER;
77.202 + gridBagConstraints.weightx = 1.0;
77.203 + gridBagConstraints.insets = new Insets(11, 12, 12, 12);
77.204 + JButton cancel = new JButton(NbBundle.getMessage(ProgressUI.class,"LBL_Cancel")); // NOI18N
77.205 + cancel.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(ProgressUI.class,"AD_Cancel")); // NOI18N
77.206 + cancel.addActionListener(new ActionListener() {
77.207 + public void actionPerformed(ActionEvent e) {
77.208 + finish();
77.209 + }
77.210 + });
77.211 + panel.add(cancel, gridBagConstraints);
77.212 +
77.213 + return panel;
77.214 + }
77.215 +
77.216 + // ProgressListener implementation ----------------------------------------
77.217 +
77.218 + public void handleProgressEvent(ProgressEvent progressEvent) {
77.219 + DeploymentStatus status = progressEvent.getDeploymentStatus();
77.220 + StateType state = status.getState();
77.221 + if (state == StateType.COMPLETED) {
77.222 + progress(status.getMessage());
77.223 + } else if (state == StateType.RUNNING) {
77.224 + progress(status.getMessage());
77.225 + } else if (state == StateType.FAILED) {
77.226 + failed(status.getMessage());
77.227 + } else if (state == StateType.RELEASED) {
77.228 + failed(status.getMessage());
77.229 + }
77.230 + }
77.231 +}
78.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
78.2 +++ b/compapp.manager.jbi/src/org/netbeans/modules/sun/manager/jbi/util/Utils.java Fri Oct 20 12:37:37 2006 +0000
78.3 @@ -0,0 +1,168 @@
78.4 +/*
78.5 + * The contents of this file are subject to the terms of the Common Development
78.6 + * and Distribution License (the License). You may not use this file except in
78.7 + * compliance with the License.
78.8 + *
78.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
78.10 + * or http://www.netbeans.org/cddl.txt.
78.11 +
78.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
78.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
78.14 + * If applicable, add the following below the CDDL Header, with the fields
78.15 + * enclosed by brackets [] replaced by your own identifying information:
78.16 + * "Portions Copyrighted [year] [name of copyright owner]"
78.17 + *
78.18 + * The Original Software is NetBeans. The Initial Developer of the Original
78.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
78.20 + * Microsystems, Inc. All Rights Reserved.
78.21 + */
78.22 +
78.23 +package org.netbeans.modules.sun.manager.jbi.util;
78.24 +
78.25 +import java.awt.Image;
78.26 +import java.beans.BeanInfo;
78.27 +import java.beans.IntrospectionException;
78.28 +import java.beans.Introspector;
78.29 +import java.beans.PropertyDescriptor;
78.30 +import java.io.StringReader;
78.31 +import java.lang.reflect.InvocationTargetException;
78.32 +import java.lang.reflect.Method;
78.33 +import java.util.HashMap;
78.34 +import java.util.List;
78.35 +import java.util.Map;
78.36 +import java.util.TreeMap;
78.37 +
78.38 +import javax.management.Attribute;
78.39 +import javax.management.MBeanAttributeInfo;
78.40 +import javax.swing.ImageIcon;
78.41 +import javax.swing.SwingUtilities;
78.42 +import javax.xml.parsers.DocumentBuilder;
78.43 +import javax.xml.parsers.DocumentBuilderFactory;
78.44 +import javax.xml.xpath.XPath;
78.45 +import javax.xml.xpath.XPathConstants;
78.46 +import javax.xml.xpath.XPathFactory;
78.47 +import org.netbeans.modules.sun.manager.jbi.management.JBIMBeanTaskResultHandler;
78.48 +
78.49 +import org.netbeans.modules.sun.manager.jbi.nodes.JBIComponentNode;
78.50 +import org.openide.DialogDisplayer;
78.51 +import org.openide.NotifyDescriptor;
78.52 +import org.openide.util.NbBundle;
78.53 +import org.openide.util.Utilities;
78.54 +import org.openide.windows.IOProvider;
78.55 +import org.openide.windows.InputOutput;
78.56 +import org.openide.windows.OutputWriter;
78.57 +import org.w3c.dom.Document;
78.58 +import org.w3c.dom.Node;
78.59 +import org.w3c.dom.NodeList;
78.60 +import org.xml.sax.InputSource;
78.61 +
78.62 +/**
78.63 + *
78.64 + * @author jqian
78.65 + */
78.66 +public class Utils {
78.67 +
78.68 + public static Image getBadgedIcon(Class clazz, String iconName,
78.69 + String internalBadgeIconName, String externalBadgeIconName) {
78.70 +
78.71 + Image ret = new ImageIcon(clazz.getResource(iconName)).getImage();
78.72 +
78.73 + if (internalBadgeIconName != null) {
78.74 + Image internalBadgeImg = new ImageIcon(clazz.getResource(internalBadgeIconName)).getImage();
78.75 + ret = Utilities.mergeImages(ret, internalBadgeImg, 7, 7);
78.76 + }
78.77 +
78.78 + if (externalBadgeIconName != null) {
78.79 + Image externalBadgeImg = new ImageIcon(clazz.getResource(externalBadgeIconName)).getImage();
78.80 + ret = Utilities.mergeImages(ret, externalBadgeImg, 15, 8);
78.81 + }
78.82 +
78.83 + return ret;
78.84 + }
78.85 +
78.86 + /**
78.87 + * Ensure that the specified ruannable task will run only in the event dispatch
78.88 + * thread.
78.89 + */
78.90 + public static void runInEventDispatchThread(Runnable runnable) {
78.91 + if (SwingUtilities.isEventDispatchThread()) {
78.92 + runnable.run();
78.93 + } else {
78.94 + SwingUtilities.invokeLater(runnable);
78.95 + }
78.96 + }
78.97 +
78.98 + public static Map<Attribute, MBeanAttributeInfo> getIntrospectedPropertyMap(Object bean) {
78.99 + return getIntrospectedPropertyMap(bean, false);
78.100 + }
78.101 +
78.102 + public static Map<Attribute, MBeanAttributeInfo> getIntrospectedPropertyMap(Object bean, boolean sort) {
78.103 +
78.104 + Class beanClass = bean.getClass();
78.105 + BeanInfo beanInfo = null;
78.106 + try {
78.107 + beanInfo = Introspector.getBeanInfo(beanClass, Object.class);
78.108 + } catch (IntrospectionException ex) {
78.109 + System.err.println("Couldn't introspect " + beanClass.getName()); // NOI18N
78.110 + return null;
78.111 + }
78.112 +
78.113 +// Map map = sort ? new TreeMap() : new HashMap(); // NB IDE BUG
78.114 +
78.115 + Map<Attribute, MBeanAttributeInfo> map = null;
78.116 + if (sort) {
78.117 + map = new TreeMap<Attribute, MBeanAttributeInfo>();
78.118 + } else {
78.119 + map = new HashMap<Attribute, MBeanAttributeInfo>();
78.120 + }
78.121 +
78.122 + PropertyDescriptor[] propDescriptors = beanInfo.getPropertyDescriptors();
78.123 +
78.124 + for (int i = 0; i < propDescriptors.length; i++) {
78.125 + Class propertyTypeClass = propDescriptors[i].getPropertyType();
78.126 + Method readMethod = propDescriptors[i].getReadMethod();
78.127 + Method writeMethod = propDescriptors[i].getWriteMethod();
78.128 +
78.129 + if (readMethod != null) {
78.130 + String propertyType = propertyTypeClass.getName();
78.131 + String propertyName = propDescriptors[i].getName();
78.132 + String propertyDesc = propDescriptors[i].getShortDescription();
78.133 + Object propertyValue = null;
78.134 + try {
78.135 + propertyValue = readMethod.invoke(bean, (Object[])null);
78.136 + } catch (IllegalArgumentException e) {
78.137 + e.printStackTrace();
78.138 + } catch (IllegalAccessException e) {
78.139 + e.printStackTrace();
78.140 + } catch (InvocationTargetException e) {
78.141 + e.printStackTrace();
78.142 + }
78.143 + Attribute attr = new Attribute(propertyName, propertyValue);
78.144 + if (sort) {
78.145 + attr = new ComparableAttribute(attr);
78.146 + }
78.147 + map.put(attr,
78.148 + new MBeanAttributeInfo(propertyName, propertyType,
78.149 + propertyDesc,
78.150 + readMethod != null, writeMethod != null,
78.151 + readMethod.getName().startsWith("is"))); // NOI18N
78.152 + }
78.153 + }
78.154 +
78.155 + return map;
78.156 + }
78.157 +
78.158 + private static Document getDocument(String xmlString) {
78.159 + try {
78.160 + DocumentBuilderFactory documentBuilderFactory =
78.161 + DocumentBuilderFactory.newInstance();
78.162 + DocumentBuilder documentBuilder =
78.163 + documentBuilderFactory.newDocumentBuilder();
78.164 + return documentBuilder.parse(new InputSource(new StringReader(xmlString)));
78.165 +
78.166 + } catch (Exception e) {
78.167 + System.out.println("Error parsing XML string: " + e); // NOI18N
78.168 + return null;
78.169 + }
78.170 + }
78.171 +}