| <!doctype html> |
| <html class="no-js" lang="en" dir="ltr"> |
| <head> |
| <meta charset="utf-8"> |
| <meta http-equiv="x-ua-compatible" content="ie=edge"> |
| <title>NetBeans Server-Skeleton Module Tutorial</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <meta name="description" content="NetBeans Server-Skeleton Module Tutorial - Apache NetBeans"> |
| <meta name="author" content="Apache NetBeans"> |
| <meta name="description" content="NetBeans Server-Skeleton Module Tutorial - Apache NetBeans"> |
| <meta name="keywords" content="Apache NetBeans Platform, Platform Tutorials, NetBeans Server-Skeleton Module Tutorial"> |
| <meta name="generator" content="Apache NetBeans"> |
| <link rel="stylesheet" href="../../../../_/css/font-awesome.min.css"> |
| <link rel="alternate" type="application/atom+xml" title="Apache NetBeans Blog" href="https://netbeans.apache.org/blogs/atom" /> |
| <link rel="stylesheet" href="../../../../_/css/highlightjs/default.min.css"> |
| <link rel="stylesheet" href="../../../../_/css/netbeans.css"> |
| <link rel="apple-touch-icon" sizes="180x180" href="../../../../_/images/fav/apple-touch-icon.png"> |
| <link rel="icon" type="image/png" sizes="32x32" href="../../../../_/images/fav/favicon-32x32.png"> |
| <link rel="icon" type="image/png" sizes="16x16" href="../../../../_/images/fav/favicon-16x16.png"> |
| <link rel="manifest" href="../../../../_/images/fav/site.webmanifest"> |
| <link rel="mask-icon" href="../../../../_/images/fav/safari-pinned-tab.svg" color="#5bbad5"> |
| <meta name="msapplication-TileColor" content="#ffc40d"> |
| <meta name="theme-color" content="#ffffff"> |
| <link href="../../../../_/css/font-open-sans.css" rel="stylesheet"> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| http://www.apache.org/licenses/LICENSE-2.0 |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| </head> |
| <body> |
| <div class="title-bar" data-responsive-toggle="responsive-menu" data-hide-for="medium"> |
| <button type="button" data-toggle="responsive-menu"><i style='font-size: 32px; color: #fff; padding: 8px' class='fa fa-bars'></i></button> |
| <div class="title-bar-title">Apache NetBeans</div> |
| </div> |
| <div class="top-bar" id="responsive-menu"> |
| <div class='top-bar-left'> |
| <a class='title' href="../../../../index.html"><img src='../../../../_/images/apache-netbeans.svg' style='padding: 8px; height: 48px;'> Apache NetBeans</a> |
| </div> |
| <div class="top-bar-right"> |
| <ul class="vertical medium-horizontal menu" data-responsive-menu="drilldown medium-dropdown"> |
| <li> <input id="search-input" type="text" placeholder="Search the docs"> </li> |
| <li> <a href="../../../../front/main/community">Community</a> </li> |
| <li> <a href="../../../../front/main/participate">Participate</a> </li> |
| <li> <a href="../../../../front/main/blogs">Blog</a></li> |
| <li> <a href="../../../../front/main/help">Get Help</a> </li> |
| <li> <a href="https://plugins.netbeans.apache.org/">Plugins</a> </li> |
| <li> <a href="../../../../front/main/download">Download</a> </li> |
| </ul> |
| </div> |
| </div> |
| |
| <!-- src/templates/news --> |
| <section class="hero news alternate"> |
| <div class='grid-container'> |
| <div class='cell'> |
| <div class="annotation">Latest release</div> |
| <h1>Apache NetBeans 27</h1> |
| <p><a class="button success" href="../../../../front/main/download/nb27">Download</a></p> |
| </div> |
| </div> |
| </section> |
| <div class='grid-container main-content tutorial'> |
| <h1 class="sect0">NetBeans Server-Skeleton Module Tutorial</h1> |
| <div class="sectionbody"> |
| <div class="admonitionblock note"> |
| <table> |
| <tbody><tr> |
| <td class="icon"><i class="fa icon-note" title="Note"></i></td> |
| <td class="content">This tutorial needs a review. |
| You can <a href="https://github.com/apache/netbeans-antora-tutorials/edit/main/modules/ROOT/pages/tutorials/nbm-server-plugin.adoc" title="Edit this tutorial in github">edit it in GitHub </a> |
| following these <a href="../../../../tutorial/main/kb/docs/contributing">contribution guidelines.</a></td> |
| </tr></tbody> |
| </table> |
| </div> |
| </div> |
| <div id="toc" class="toc"> |
| <div id="toctitle"></div> |
| <ul class="sectlevel1"> |
| <li><a href="#_getting_to_know_the_sample">Getting to Know the Sample</a> |
| <ul class="sectlevel2"> |
| <li><a href="#_installing_the_software">Installing the Software</a></li> |
| <li><a href="#_installing_the_sample">Installing the Sample</a></li> |
| <li><a href="#_introducing_the_sample">Introducing the Sample</a></li> |
| <li><a href="#_introducing_the_sources">Introducing the Sources</a></li> |
| </ul> |
| </li> |
| <li><a href="#_setting_up_the_module_project">Setting Up the module Project</a> |
| <ul class="sectlevel2"> |
| <li><a href="#_creating_the_module_project">Creating the Module Project</a></li> |
| <li><a href="#_specifying_the_modules_dependencies">Specifying the Module’s Dependencies</a></li> |
| </ul> |
| </li> |
| <li><a href="#_creating_the_factory_classes">Creating the Factory Classes</a> |
| <ul class="sectlevel2"> |
| <li><a href="#_mydeploymentfactory_java">MyDeploymentFactory.java</a></li> |
| <li><a href="#_myj2eeplatformfactory_java">MyJ2eePlatformFactory.java</a></li> |
| <li><a href="#_myoptionalfactory_java">MyOptionalFactory.java</a></li> |
| <li><a href="#_myregistrynodefactory_java">MyRegistryNodeFactory.java</a></li> |
| </ul> |
| </li> |
| <li><a href="#_creating_the_implementation_classes">Creating the Implementation Classes</a> |
| <ul class="sectlevel2"> |
| <li><a href="#_configurationsupportimpl_java">ConfigurationSupportImpl.java</a></li> |
| <li><a href="#_myconfiguration_java">MyConfiguration.java</a></li> |
| <li><a href="#_mydeploymentmanager_java">MyDeploymentManager.java</a></li> |
| <li><a href="#_myinstantiatingiterator_java">MyInstantiatingIterator.java</a></li> |
| <li><a href="#_myj2eeplatformimpl_java">MyJ2eePlatformImpl.java</a></li> |
| <li><a href="#_mystartserver_java">MyStartServer.java</a></li> |
| <li><a href="#_myinstancenode_java">MyInstanceNode.java</a></li> |
| </ul> |
| </li> |
| <li><a href="#_setting_up_the_supporting_files">Setting Up the Supporting Files</a> |
| <ul class="sectlevel2"> |
| <li><a href="#_registering_the_new_server_in_the_netbeans_filesystem">Registering the New Server in the NetBeans Filesystem</a></li> |
| <li><a href="#_localizing_the_module">Localizing the module</a></li> |
| <li><a href="#_getting_the_icon">Getting the Icon</a></li> |
| </ul> |
| </li> |
| <li><a href="#_building_and_installing_the_module">Building and Installing the Module</a> |
| <ul class="sectlevel2"> |
| <li><a href="#_installing_the_server_skeleton_module">Installing the Server-Skeleton Module</a></li> |
| <li><a href="#_using_the_server_skeleton_module">Using the Server-Skeleton Module</a></li> |
| </ul> |
| </li> |
| <li><a href="#_adding_server_specific_code">Adding Server-Specific Code</a></li> |
| <li><a href="#_next_steps">Next Steps</a></li> |
| <li><a href="#_versioning_and_known_issues_in_this_tutorial">Versioning and Known Issues in this Tutorial</a></li> |
| </ul> |
| </div> |
| <div id="preamble"> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p><a href="../../../../front/main/community/mailing-lists/" class="xref page">Feedback</a></p> |
| </div> |
| <div class="paragraph"> |
| <p>This tutorial is intended to ease the <em>initial</em> phase of developing NetBeans modules that provide support for web deployment servers, such as the Tomcat Web Server or the Sun Java System Application Server. It provides the code for a skeleton server module, together with a detailed procedure for creating it from scratch and a full description of each of its parts. Since this is "just" a <em>skeleton</em> module, server-specific features that relate to starting and stopping, deploying, undeploying, and property customization are not covered here. However, after you create and install the skeleton server module, you will have enough functionality to be able to register a new deployment server in the Server Manager and assign it to an application via the New Project wizard and the Project Properties dialog box. And, you will have a working framework on top of which you can build your own server module for the NetBeans IDE. At the end of the tutorial, you will be pointed to comparable deployment servers in NetBeans CVS, which you can explore to see how server-specific features are implemented elsewhere.</p> |
| </div> |
| <div class="paragraph"> |
| <p>The following topics are covered below:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><a href="#gettingtoknowthesample">Getting to Know the Sample</a></p> |
| </li> |
| <li> |
| <p><a href="#installing">Installing the Software</a></p> |
| </li> |
| <li> |
| <p><a href="#installing-sample">Installing the Sample</a></p> |
| </li> |
| <li> |
| <p><a href="#introducing-sample">Introducing the Sample</a></p> |
| </li> |
| <li> |
| <p><a href="#introducing-sources">Introducing the Sources</a></p> |
| </li> |
| <li> |
| <p><a href="#settingupthemoduleproject">Setting Up the module Project</a></p> |
| </li> |
| <li> |
| <p><a href="#creatingthemoduleproject">Creating the module Project</a></p> |
| </li> |
| <li> |
| <p><a href="#specifying">Specifying the module’s Dependencies</a></p> |
| </li> |
| <li> |
| <p><a href="#creatingandgettingtoknowthemainfiles">Creating the Factory Classes</a></p> |
| </li> |
| <li> |
| <p><a href="#MyDeploymentFactory"><code>MyDeploymentFactory.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyJ2eePlatformFactory"><code>MyJ2eePlatformFactory.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyOptionalFactory"><code>MyOptionalFactory.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyRegistryNodeFactory"><code>MyRegistryNodeFactory.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#creatingandgettingtoknowtheimplementationfiles">Creating the Implementation Classes</a></p> |
| </li> |
| <li> |
| <p><a href="#ConfigurationSupportImpl"><code>ConfigurationSupportImpl.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyConfiguration"><code>MyConfiguration.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyDeploymentManager"><code>MyDeploymentManager.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyInstantiatingIterator"><code>MyInstantiatingIterator.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyJ2eePlatformImpl"><code>MyJ2eePlatformImpl.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyStartServer"><code>MyStartServer.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyInstanceNode"><code>MyInstanceNode.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#finetuning">Setting Up the Supporting Resources</a></p> |
| </li> |
| <li> |
| <p><a href="#building">Building and Installing the Module</a></p> |
| </li> |
| <li> |
| <p><a href="#addingserverspecific">Adding Server-Specific Code</a></p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>Once the software is installed, this tutorial can be completed in 60 minutes.</p> |
| </div> |
| <div class="paragraph"> |
| <p>For more information on working with NetBeans modules, see the <a href="../../kb/docs/platform/" class="xref page"> NetBeans Module and Rich-Client Application tutorials page</a> on the NetBeans website. If you have questions, visit the <a href="../../../../wiki/main/netbeansdevelopperfaq/DevFaqIndex/" class="xref page"> NetBeans Developer FAQ</a> or use the feedback link at the top of this page.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_getting_to_know_the_sample"><a class="anchor" href="#_getting_to_know_the_sample"></a>Getting to Know the Sample</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Before you start writing the module, you have to make sure you have all of the necessary software. In addition, you might want to play with the sample before building it yourself. Getting to know the sample lets you know what you are in for during the rest of this tutorial!</p> |
| </div> |
| <div class="sect2"> |
| <h3 id="_installing_the_software"><a class="anchor" href="#_installing_the_software"></a>Installing the Software</h3> |
| <div class="paragraph"> |
| <p>Before you begin, you need to install the following software on your computer:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>NetBeans IDE 5.5 ( <a href="../../../../front/main/download/" class="xref page">download</a>). Note that this tutorial was originally written for NetBeans IDE 5.0, but that version of this tutorial is no longer supported.</p> |
| </li> |
| <li> |
| <p>Java Standard Development Kit (JDKâ„¢) version 1.4.2 ( <a href="https://www.oracle.com/technetwork/java/javase/downloads/index.html">download</a>) or 5.0 ( <a href="https://www.oracle.com/technetwork/java/javase/downloads/index.html">download</a>)</p> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_installing_the_sample"><a class="anchor" href="#_installing_the_sample"></a>Installing the Sample</h3> |
| <div class="paragraph"> |
| <p>Take the following steps to install the sample:</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Unzip the <a href="https://netbeans.org/files/documents/4/519/myserver.zip">attached file</a>.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>In the IDE, choose File > Open Project and browse to the folder that contains the unzipped file. Open the module project. It should look as follows:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/myserver_projects-window.png" alt="myserver projects window"> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="3"> |
| <li> |
| <p>In the Projects window, right-click the "My Server Module" project node and choose Install/Reload in Target Platform. The target instance of the IDE opens and the module is installed. Alternatively, if you want to install the module in the current instance of the IDE, choose Install/Reload in Development IDE instead.</p> |
| </li> |
| </ol> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_introducing_the_sample"><a class="anchor" href="#_introducing_the_sample"></a>Introducing the Sample</h3> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Choose Tools > Server Manager, click Add Server and notice that a new server is available:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/myserver_choose-server.png" alt="myserver choose server"> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Select "My Server" and type a name, such as "Test Server", in the Name textfield:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="3"> |
| <li> |
| <p>Click Next. The basis of an installation form implementation is displayed:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/myserver_add-server-instance.png" alt="myserver add server instance"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>See <a href="#MyInstantiatingIterator"><code>MyInstantiatingIterator.java</code> </a> for related code details.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="4"> |
| <li> |
| <p>Click Finish. A new node appears in the Servers list and the basis of a customizer implementation is displayed in the main part of the panel:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/myserver_add-server-instance3.png" alt="myserver add server instance3"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>See <a href="#MyInstanceNode"><code>MyInstanceNode.java</code> </a> for related code details.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="5"> |
| <li> |
| <p>Click Close. Open the Runtime window (Ctrl-5) and notice the new "Test Server" node under the Servers node. When you right-click the node, the basis of your menu implementation is displayed:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/myserver_runtime-window.png" alt="myserver runtime window"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Even though the skeleton server cannot be started, you can assign it as a target server to an application, as shown in the next step.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="6"> |
| <li> |
| <p>Assign the server as an application’s target server, either while creating the web application or afterwards, while customizing it:</p> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>Choose File > New Project (Ctrl-Shift-N). Under Categories, select Web and under Projects select Web Application. Click Next. In the Name and Location panel, notice that the Server drop-down includes the new server instance:</p> |
| </li> |
| </ul> |
| </div> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/myserver_name-and-location-panel.png" alt="myserver name and location panel"> |
| </div> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>Right-click an existing web application and choose Properties. The Project Properties dialog box opens. In the Run panel, notice that the Server drop-down includes the new server type:</p> |
| </li> |
| </ul> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/myserver_run-panel.png" alt="myserver run panel"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Now that you know exactly what functionality the skeleton server provides, let’s look at the sources!</p> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_introducing_the_sources"><a class="anchor" href="#_introducing_the_sources"></a>Introducing the Sources</h3> |
| <div class="paragraph"> |
| <p>The sample consists of factory classes, implementation classes, and supporting files.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Below, each are introduced in turn:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><strong>Factory Classes.</strong> The module uses the Factory pattern to instantiate the implementation classes. The module’s factories are highlighted in the illustration below:</p> |
| </li> |
| </ul> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/myserver_projects-window-factories.png" alt="myserver projects window factories"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>The factories are introduced in alphabetical order:</p> |
| </div> |
| <table class="tableblock frame-all grid-all stretch"> |
| <colgroup> |
| <col style="width: 50%;"> |
| <col style="width: 50%;"> |
| </colgroup> |
| <thead> |
| <tr> |
| <th class="tableblock halign-left valign-top"><strong>File</strong></th> |
| <th class="tableblock halign-left valign-top"><strong>Description</strong></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="#MyDeploymentFactory">MyDeploymentFactory.java</a></code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">An implementation of the <code> <a href="https://docs.oracle.com/javaee/1.4/api/javax/enterprise/deploy/spi/factories/DeploymentFactory.html">DeploymentFactory</a></code> interface, which produces instances of <code> <a href="https://docs.oracle.com/javaee/1.4/api/javax/enterprise/deploy/spi/DeploymentManager.html">DeploymentManager</a></code> interface implementations, such as <a href="#MyDeploymentManager"><code>MyDeploymentManager</code> </a>.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="#MyJ2eePlatformFactory">MyJ2eePlatformFactory.java</a></code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">An implementation of the <code> <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/J2eePlatformFactory.html">J2eePlatformFactory</a></code> abstract class, which produces instances of <code> <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/J2eePlatformImpl.html">J2eePlatformImpl</a></code> abstract class implementations, such as <a href="#MyJ2eePlatformImpl"><code>MyJ2eePlatformImpl</code> </a>.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="#MyOptionalFactory">MyOptionalFactory.java</a></code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">An implementation of the <code> <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/OptionalDeploymentManagerFactory.html">OptionalDeploymentManagerFactory</a></code> abstract class. Although its name implies that it is <em>optional</em>, it isn’t. You need to at least implement its methods for starting, stopping, and registering the server in the IDE. Therefore, the <code><a href="#MyOptionalFactory">MyOptionalFactory</a></code> class produces instances of the <a href="#MyStartServer"><code>MyStartServer</code> </a> and <a href="#MyInstantiatingIterator"><code>MyInstantiatingIterator</code> </a> implementation classes.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="#MyRegistryNodeFactory">MyRegistryNodeFactory.java</a></code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">An implementation of the <code> <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/RegistryNodeFactory.html">RegistryNodeFactory</a></code> interface. The purpose of this factory is to produce one or more registry nodes, which in this case is <a href="#MyInstanceNode"><code>MyInstanceNode</code> </a>, as user interface representations in the Runtime window.</p></td> |
| </tr> |
| </tbody> |
| </table> |
| <div class="paragraph"> |
| <p>* |
| <strong>Implementation Classes.</strong> The implementation classes are instantiated by the factories. The module’s implementation classes are highlighted in the illustration below:</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/myserver_projects-window-mainfunctionality.png" alt="myserver projects window mainfunctionality"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>The implementation classes are introduced in alphabetical order:</p> |
| </div> |
| <table class="tableblock frame-all grid-all stretch"> |
| <colgroup> |
| <col style="width: 50%;"> |
| <col style="width: 50%;"> |
| </colgroup> |
| <thead> |
| <tr> |
| <th class="tableblock halign-left valign-top"><strong>File</strong></th> |
| <th class="tableblock halign-left valign-top"><strong>Description</strong></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#ConfigurationSupportImpl"><code>ConfigurationSupportImpl.java</code> </a></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">An implementation of the NetBeans API’s <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/ConfigurationSupport.html">ConfigurationSupport</a> interface. This class is the NetBeans extension of the <a href="https://docs.oracle.com/javaee/1.4/api/javax/enterprise/deploy/spi/DeploymentConfiguration.html">DeploymentConfiguration</a> interface, which is a J2EE API class and therefore could not be changed. This extension adds life cycle management and additional module change notifications support.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#MyConfiguration"><code>MyConfiguration.java</code> </a></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">An implementation of the <a href="https://docs.oracle.com/javaee/1.4/api/javax/enterprise/deploy/spi/DeploymentConfiguration.html">DeploymentConfiguration</a> interface. The purpose of this class is to provide support for server-specific configuration, in other words, it relates to deployment descriptors.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#MyDeploymentManager"><code>MyDeploymentManager.java</code> </a></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">A dummy implementation of the <code> <a href="https://docs.oracle.com/javaee/1.4/api/javax/enterprise/deploy/spi/DeploymentManager.html">DeploymentManager</a></code> interface, which does nothing more than return <a href="#MyConfiguration"><code>MyConfiguration.java</code> </a>. It is up to you to provide other server-specific implementation features.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#MyInstantiatingIterator"><code>MyInstantiatingIterator.java</code> </a></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Creates a wizard for the registration of new server type instances in the IDE. The current implementation lets the user specify the Display Name only; other properties are hardcoded in order to keep the implementation as simple as possible.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#MyJ2eePlatformImpl"><code>MyJ2eePlatformImpl.java</code> </a></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">An implementation of <code> <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/J2eePlatformImpl.html">J2eePlatformImpl</a></code> , which is used to describe the target environment that J2EE applications are built against and subsequently deployed to. It provides a set of server libraries, supported module types, and J2EE specification versions.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#MyStartServer"><code>MyStartServer.java</code> </a></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">An implementation of the <code> <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/StartServer.html">StartServer</a></code> abstract class. Its purpose is to provide ability to start, stop, and determine the state of the server.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#MyInstanceNode"><code>MyInstanceNode.java</code> </a></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Represents the new server in the Runtime window. The <code>j2eeserver</code> module, however, adds to each node a set of default features, such as the capability to display the running status and a default set of menu items.</p></td> |
| </tr> |
| </tbody> |
| </table> |
| <div class="paragraph"> |
| <p>* |
| <strong>Supporting Resources.</strong> The module’s supporting resources are highlighted in the illustration below:</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/myserver_projects-window-supporting.png" alt="myserver projects window supporting"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>The supporting resources in the Java packages are introduced in alphabetical order below:</p> |
| </div> |
| <table class="tableblock frame-all grid-all stretch"> |
| <colgroup> |
| <col style="width: 50%;"> |
| <col style="width: 50%;"> |
| </colgroup> |
| <thead> |
| <tr> |
| <th class="tableblock halign-left valign-top"><strong>File</strong></th> |
| <th class="tableblock halign-left valign-top"><strong>Description</strong></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="#Bundle.properties">Bundle.properties</a></code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">This is a standard Java properties file, which uses the syntax <code>Key=Value</code> . Keys are code names for things that appear in the source code, with values designating those things which will be displayed to the user. This file is useful for localization. For example, by creating a properties file such as <code>Bundle_ja.properties</code> , and filling all the values with Japanese, this module will automatically display everything in Japanese, if the user is running the IDE in Japanese mode.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="#layer.xml">layer.xml</a></code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Registers the new server type in the NetBeans filesystem.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="#nbdep.xml">nbdep.xml</a></code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Specifies the icon to be used in the Runtime window, the URL for obtaining the disconnected <code>DeploymentManager</code> instance, the <code>container-limitation element</code> that specifies what kind of deployments are supported, and the context path.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="#server.gif">server.gif</a></code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Icon for the new server type’s node in the IDE.</p></td> |
| </tr> |
| </tbody> |
| </table> |
| <div class="paragraph"> |
| <p>For basic information each of the Important Files, see the <a href="../nbm-quick-start/" class="xref page">Introduction to NetBeans Module Development</a>.</p> |
| </div> |
| <div class="paragraph"> |
| <p>We have now looked at the features provided by the server skeleton and at each of the files that you need to create it from scratch. Let’s now go through the whole process from start to finish, during which we will recreate the whole server skeleton. At the end, we will look at further resources worth exploring when building your own server implementation on top of the server skeleton.</p> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_setting_up_the_module_project"><a class="anchor" href="#_setting_up_the_module_project"></a>Setting Up the module Project</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>The first step in creating a server module is setting up your project in the IDE. The IDE provides a wizard that sets up the source structure and all the basic files needed when you start creating a module.</p> |
| </div> |
| <div class="sect2"> |
| <h3 id="_creating_the_module_project"><a class="anchor" href="#_creating_the_module_project"></a>Creating the Module Project</h3> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Choose File > New Project. Under Categories, select NetBeans Plug-in Modules. Under Projects, select Module Project. Click Next.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>In the Name and Location panel, type <code>My Server Module</code> in Project Name. Change the Project Location to any directory on your computer, such as <code>c:\mymodules</code> . Leave the Standalone Module radiobutton selected. If not selected, select the Set as Main Project checkbox. Click Next.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="3"> |
| <li> |
| <p>In the Basic Module Configuration panel, replace <code>org.yourorghere.myservermodule</code> in Code Name Base with <code>org.netbeans.modules.j2ee.myservermodule</code> . Leave <code>My Server Module</code> as the Module Display Name. Change the location of the localizing bundle and XML layer, so that they will be stored in a package with the name <code>org.netbeans.modules.j2ee.myserver.resources</code> . Click Finish.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="paragraph"> |
| <p>The IDE creates the <code>My Server Module</code> project. The project contains all of your sources and project metadata, such as the project’s Ant build script. The project opens in the IDE. You can view its logical structure in the Projects window (Ctrl-1) and its file structure in the Files window (Ctrl-2). For example, the Projects window should now look as follows:</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/myserver_projects-window-original.png" alt="myserver projects window original"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>For basic information on each of the files created by the New Project wizard, see the <a href="../nbm-quick-start/" class="xref page">Introduction to NetBeans Module Development</a>.</p> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_specifying_the_modules_dependencies"><a class="anchor" href="#_specifying_the_modules_dependencies"></a>Specifying the Module’s Dependencies</h3> |
| <div class="paragraph"> |
| <p>You will need to subclass several classes that belong to NetBeans APIs. Each has to be declared as a module dependency. Use the Project Properties dialog box for this purpose, as shown below.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>In the Projects window, right-click the <code>My Server Module</code> project and choose Properties. In the Project Properties dialog box, click Libraries.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>For each of the APIs displayed in the list below, click "Add…​" in the Libraries panel, select the name from the Module list, and then click OK to confirm it:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/myserver_libraries-panel.png" alt="myserver libraries panel"> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="3"> |
| <li> |
| <p>Click OK to exit the Project Properties dialog box.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="4"> |
| <li> |
| <p>In the Projects window, double-click Project Metadata and note that the APIs you selected have been declared as module dependencies.</p> |
| </li> |
| </ol> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_creating_the_factory_classes"><a class="anchor" href="#_creating_the_factory_classes"></a>Creating the Factory Classes</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>The implementation classes are implemented by the factories. In this section, you will create and examine each of them:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><a href="#MyDeploymentFactory"><code>MyDeploymentFactory.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyJ2eePlatformFactory"><code>MyJ2eePlatformFactory.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyOptionalFactory"><code>MyOptionalFactory.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyRegistryNodeFactory"><code>MyRegistryNodeFactory.java</code> </a></p> |
| </li> |
| </ul> |
| </div> |
| <div class="sect2"> |
| <h3 id="_mydeploymentfactory_java"><a class="anchor" href="#_mydeploymentfactory_java"></a>MyDeploymentFactory.java</h3> |
| <div class="paragraph"> |
| <p>The <code>MyDeploymentFactory</code> class is an implementation of <code> <a href="https://docs.oracle.com/javaee/1.4/api/javax/enterprise/deploy/spi/factories/DeploymentFactory.html">DeploymentFactory</a></code> , which produces instances of the <a href="#MyDeploymentManager"><code>MyDeploymentManager</code> </a> implementation class.</p> |
| </div> |
| <div class="paragraph"> |
| <p>The following are the interesting methods in this class:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><code> <a href="https://docs.oracle.com/javaee/1.4/api/javax/enterprise/deploy/spi/factories/DeploymentFactory.html#handlesURI(java.lang.String)">handlesURI()</a>.</code> Determines whether the given <code>MyDeploymentFactory</code> can handle the specifed URI.</p> |
| </li> |
| <li> |
| <p><code> <a href="https://docs.oracle.com/javaee/1.4/api/javax/enterprise/deploy/spi/factories/DeploymentFactory.html#getDeploymentManager(java.lang.String,%20java.lang.String,%20java.lang.String)">getDeploymentManager()</a>.</code> Creates a <code>connected</code> <code>DeploymentManager</code> instance. This instance provides access to J2EE resources.</p> |
| </li> |
| <li> |
| <p><code> <a href="https://docs.oracle.com/javaee/1.4/api/javax/enterprise/deploy/spi/factories/DeploymentFactory.html#getDisconnectedDeploymentManager(java.lang.String)">getDisconnectedDeploymentManager()</a>.</code> Creates a <code>disconnected</code> <code>DeploymentManager</code> instance. This instance provides access to configuration support.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>Our new server instance will use the <code>deployer:myserver</code> prefix so that the URL used to obtain a connected deployment manager looks like this: <code>deployer:myserver:localhost:8080</code> .</p> |
| </div> |
| <div class="paragraph"> |
| <p>Do the following to create the <code>MyDeploymentFactory</code> class:</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Right-click the <code>org.netbeans.modules.j2ee.myserver</code> node and choose New > File/Folder. Under Categories, choose Java Classes. Under File Types, choose Java Class. Click Next and type <code>MyDeploymentFactory</code> in Class Name. Click Finish. The new Java class opens in the Source Editor.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Replace the default code with the code below:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package org.netbeans.modules.j2ee.myserver; |
| |
| import javax.enterprise.deploy.shared.factories.DeploymentFactoryManager; |
| import javax.enterprise.deploy.spi.DeploymentManager; |
| import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException; |
| import javax.enterprise.deploy.spi.factories.DeploymentFactory; |
| import org.openide.ErrorManager; |
| import org.openide.util.NbBundle; |
| |
| public class MyDeploymentFactory implements DeploymentFactory { |
| |
| public static final String URI_PREFIX = "deployer:myserver"; // NOI18N |
| private static DeploymentFactory instance; |
| |
| public static synchronized DeploymentFactory create() { |
| if (instance == null) { |
| instance = new MyDeploymentFactory(); |
| DeploymentFactoryManager.getInstance().registerDeploymentFactory(instance); |
| } |
| return instance; |
| } |
| |
| public boolean handlesURI(String uri) { |
| return uri != null &amp;&amp; uri.startsWith(URI_PREFIX); |
| } |
| |
| public DeploymentManager getDeploymentManager(String uri, String uname, String passwd) throws DeploymentManagerCreationException { |
| if (!handlesURI(uri)) { |
| throw new DeploymentManagerCreationException("Invalid URI:" + uri); // NOI18N |
| } |
| return new MyDeploymentManager(); |
| } |
| |
| public DeploymentManager getDisconnectedDeploymentManager(String uri) throws DeploymentManagerCreationException { |
| if (!handlesURI(uri)) { |
| throw new DeploymentManagerCreationException("Invalid URI:" + uri); // NOI18N |
| } |
| return new MyDeploymentManager(); |
| } |
| |
| public String getProductVersion() { |
| return "0.1"; // NOI18N |
| } |
| |
| public String getDisplayName() { |
| return NbBundle.getMessage(MyDeploymentFactory.class, "TXT_DisplayName"); // NOI18N |
| } |
| }</code></pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_myj2eeplatformfactory_java"><a class="anchor" href="#_myj2eeplatformfactory_java"></a>MyJ2eePlatformFactory.java</h3> |
| <div class="paragraph"> |
| <p>The <code>MyJ2eePlatformFactory</code> class is an implementation of the <code> <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/J2eePlatformFactory.html">J2eePlatformFactory</a></code> class. The implementation is very simple — it produces instances of the <a href="#MyJ2eePlatformImpl"><code>MyJ2eePlatformImpl</code> </a> class.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Do the following to create the <code>MyJ2eePlatformFactory</code> class:</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Right-click the <code>org.netbeans.modules.j2ee.myserver</code> node, choose New > Java Class, and type <code>MyJ2eePlatformFactory</code> in Class Name. Click Finish. The new Java class opens in the Source Editor.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Replace the default code with the code below:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package org.netbeans.modules.j2ee.myserver; |
| |
| import javax.enterprise.deploy.spi.DeploymentManager; |
| import org.netbeans.modules.j2ee.deployment.plugins.api.J2eePlatformFactory; |
| import org.netbeans.modules.j2ee.deployment.plugins.api.J2eePlatformImpl; |
| |
| public class MyJ2eePlatformFactory extends J2eePlatformFactory { |
| public J2eePlatformImpl getJ2eePlatformImpl(DeploymentManager dm) { |
| return new MyJ2eePlatformImpl(); |
| } |
| }</code></pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_myoptionalfactory_java"><a class="anchor" href="#_myoptionalfactory_java"></a>MyOptionalFactory.java</h3> |
| <div class="paragraph"> |
| <p>The <code>MyOptionalFactory</code> class is an implementation of <code> <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/OptionalDeploymentManagerFactory.html">OptionalDeploymentManagerFactory</a></code> . Despite its name, this factory class is <em>not</em> optional. At least two methods need to be implemented:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><code> <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/OptionalDeploymentManagerFactory.html#getStartServer(javax.enterprise.deploy.spi.DeploymentManager)">getStartServer()</a>.</code> Starts and stops the server.</p> |
| </li> |
| <li> |
| <p><code> <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/OptionalDeploymentManagerFactory.html#getAddInstanceIterator()">getAddInstanceIterator()</a>.</code> Creates the wizard for registering the server in the IDE.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>The other two methods are not implemented here:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><code> <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/OptionalDeploymentManagerFactory.html#getIncrementalDeployment(javax.enterprise.deploy.spi.DeploymentManager)">getIncrementalDeployment()</a>.</code> Creates <code>IncrementalDeployment</code> , which offers an alternative way, which is more convenient for development..</p> |
| </li> |
| <li> |
| <p><code> <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/OptionalDeploymentManagerFactory.html#getFindJSPServlet(javax.enterprise.deploy.spi.DeploymentManager)">getFindJSPServlet()</a>.</code> Creates <code>FindJSPServlet</code> , which lets modules specify the location of servlets generated for JSPs.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>Do the following to create the MyOptionalFactory class:</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Right-click the <code>org.netbeans.modules.j2ee.myserver</code> node, choose New > Java Class, and type <code>MyOptionalFactory</code> in Class Name. Click Finish. The new Java class opens in the Source Editor.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Replace the default code with the code below:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package org.netbeans.modules.j2ee.myserver; |
| |
| import javax.enterprise.deploy.spi.DeploymentManager; |
| import org.netbeans.modules.j2ee.deployment.plugins.api.FindJSPServlet; |
| import org.netbeans.modules.j2ee.deployment.plugins.api.IncrementalDeployment; |
| import org.netbeans.modules.j2ee.deployment.plugins.api.OptionalDeploymentManagerFactory; |
| import org.netbeans.modules.j2ee.deployment.plugins.api.StartServer; |
| import org.openide.WizardDescriptor.InstantiatingIterator; |
| |
| public class MyOptionalFactory extends OptionalDeploymentManagerFactory { |
| |
| public StartServer getStartServer(DeploymentManager dm) { |
| return new MyStartServer(); |
| } |
| |
| public IncrementalDeployment getIncrementalDeployment(DeploymentManager dm) { |
| return null; |
| } |
| |
| public FindJSPServlet getFindJSPServlet(DeploymentManager dm) { |
| return null; |
| } |
| |
| public InstantiatingIterator getAddInstanceIterator() { |
| return new MyInstantiatingIterator(); |
| } |
| }</code></pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_myregistrynodefactory_java"><a class="anchor" href="#_myregistrynodefactory_java"></a>MyRegistryNodeFactory.java</h3> |
| <div class="paragraph"> |
| <p>The <code>MyRegistryNodeFactory</code> class is an implementation of <code> <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/RegistryNodeFactory.html">RegistryNodeFactory</a></code> . The purpose of this factory is to produce server and target nodes, which are used as user interface representations in the Runtime window. Since the new server type only has one target and its Admin Server is therefore also a target server, you do not need to implement the target node.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Right-click the <code>org.netbeans.modules.j2ee.myserver</code> node, choose New > Java Class, and type <code>MyRegistryNodeFactory</code> in Class Name. Click Finish. The new Java class opens in the Source Editor.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Replace the default code with the code below:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package org.netbeans.modules.j2ee.myserver.nodes; |
| |
| import org.netbeans.modules.j2ee.deployment.plugins.api.RegistryNodeFactory; |
| import org.openide.nodes.Children; |
| import org.openide.nodes.Node; |
| import org.openide.util.Lookup; |
| |
| public class MyRegistryNodeFactory implements RegistryNodeFactory { |
| |
| public Node getTargetNode(Lookup lookup) { |
| return null; |
| } |
| |
| public Node getManagerNode(Lookup lookup) { |
| return new MyInstanceNode(lookup); |
| } |
| }</code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_creating_the_implementation_classes"><a class="anchor" href="#_creating_the_implementation_classes"></a>Creating the Implementation Classes</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>The implementation classes are implemented by the factories. In this section, you will create and examine each of them:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><a href="#ConfigurationSupportImpl"><code>ConfigurationSupportImpl.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyConfiguration"><code>MyConfiguration.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyDeploymentManager"><code>MyDeploymentManager.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyInstantiatingIterator"><code>MyInstantiatingIterator.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyJ2eePlatformImpl"><code>MyJ2eePlatformImpl.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyStartServer"><code>MyStartServer.java</code> </a></p> |
| </li> |
| <li> |
| <p><a href="#MyInstanceNode"><code>MyInstanceNode.java</code> </a></p> |
| </li> |
| </ul> |
| </div> |
| <div class="sect2"> |
| <h3 id="_configurationsupportimpl_java"><a class="anchor" href="#_configurationsupportimpl_java"></a>ConfigurationSupportImpl.java</h3> |
| <div class="paragraph"> |
| <p>An implementation of the NetBeans API’s <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/ConfigurationSupport.html">ConfigurationSupport</a> interface. This class is the NetBeans extension of the <a href="https://docs.oracle.com/javaee/1.4/api/javax/enterprise/deploy/spi/DeploymentConfiguration.html">DeploymentConfiguration</a> interface, which is a J2EE API class and therefore could not be changed. This extension adds life cycle management and additional module change notifications support.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Right-click the <code>org.netbeans.modules.j2ee.myserver</code> node, choose New > Java Class, and type <code>ConfigurationSupportImpl</code> in Class Name. Click Finish. The new Java class opens in the Source Editor.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Replace the default code with the code below:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package org.netbeans.modules.j2ee.myserver; |
| |
| import java.io.File; |
| import javax.enterprise.deploy.model.DDBean; |
| import javax.enterprise.deploy.model.DeployableObject; |
| import javax.enterprise.deploy.spi.DeploymentConfiguration; |
| import javax.enterprise.deploy.spi.exceptions.ConfigurationException; |
| import org.netbeans.modules.j2ee.deployment.common.api.OriginalCMPMapping; |
| import org.netbeans.modules.j2ee.deployment.plugins.api.ConfigurationSupport; |
| |
| |
| public class ConfigurationSupportImpl extends ConfigurationSupport { |
| |
| public void setMappingInfo(DeploymentConfiguration config, OriginalCMPMapping[] mappings) { |
| } |
| |
| public void ensureResourceDefined(DeploymentConfiguration config, DDBean bean) { |
| } |
| |
| public String getWebContextRoot(DeploymentConfiguration config, DeployableObject deplObj) |
| throws ConfigurationException { |
| return ((MyConfiguration)config).getContextPath(); |
| } |
| |
| public void setWebContextRoot(DeploymentConfiguration config, DeployableObject deplObj, String contextRoot) |
| throws ConfigurationException { |
| ((MyConfiguration)config).setContextPath(contextRoot); |
| } |
| |
| public void initConfiguration(DeploymentConfiguration config, File[] files, |
| File resourceDir, boolean keepUpdated) throws ConfigurationException { |
| ((MyConfiguration)config).init(files[0]); |
| } |
| |
| public void disposeConfiguration(DeploymentConfiguration config) { |
| } |
| |
| public void updateResourceDir(DeploymentConfiguration config, File resourceDir) { |
| } |
| }</code></pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_myconfiguration_java"><a class="anchor" href="#_myconfiguration_java"></a>MyConfiguration.java</h3> |
| <div class="paragraph"> |
| <p>An implementation of the <a href="https://docs.oracle.com/javaee/1.4/api/javax/enterprise/deploy/spi/DeploymentConfiguration.html">DeploymentConfiguration</a> interface. The purpose of this class is to provide support for server-specific configuration, in other words, it relates to deployment descriptors.</p> |
| </div> |
| <div class="admonitionblock note"> |
| <table> |
| <tr> |
| <td class="icon"> |
| <i class="fa icon-note" title="Note"></i> |
| </td> |
| <td class="content"> |
| The previous versions of the j2eeserver API required plug-ins to use the <code>DConfigBean</code> based model for s erver specific-deployment descriptor representations; this is not needed anymore. Plug-ins are now allowed to use any model representation they want, typically a schema2beans-based model, a nd are also in charge of saving and loading the deployment configuration. Because of the redesign, the following <code>DeploymentConfiguration</code> methods are no longer used: <code>getDConfigBeanRoot()</code> , <code>removeDConfigBean()</code> , <code>restore()</code> , <code>restoreDConfigBean()</code> , and <code>saveDConfigBean()</code> . On the other hand, new methods were added through the <code>ConfigurationSupport</code> interface. |
| </td> |
| </tr> |
| </table> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Right-click the <code>org.netbeans.modules.j2ee.myserver</code> node, choose New > Java Class, and type <code>MyConfiguration</code> in Class Name. Click Finish. The new Java class opens in the Source Editor.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Replace the default code with the code below:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package org.netbeans.modules.j2ee.myserver; |
| |
| import java.io.File; |
| import java.io.IOException; |
| import java.io.InputStream; |
| import java.io.OutputStream; |
| import java.io.OutputStreamWriter; |
| import java.io.PrintWriter; |
| import javax.enterprise.deploy.model.DDBean; |
| import javax.enterprise.deploy.model.DDBeanRoot; |
| import javax.enterprise.deploy.model.DeployableObject; |
| import javax.enterprise.deploy.model.XpathEvent; |
| import javax.enterprise.deploy.model.XpathListener; |
| import javax.enterprise.deploy.spi.DConfigBeanRoot; |
| import javax.enterprise.deploy.spi.DeploymentConfiguration; |
| import javax.enterprise.deploy.spi.exceptions.BeanNotFoundException; |
| import javax.enterprise.deploy.spi.exceptions.ConfigurationException; |
| import org.openide.ErrorManager; |
| import org.openide.filesystems.FileLock; |
| import org.openide.filesystems.FileObject; |
| import org.openide.filesystems.FileUtil; |
| |
| |
| public class MyConfiguration implements DeploymentConfiguration, XpathListener { |
| |
| private DeployableObject deplObj; |
| |
| public MyConfiguration (DeployableObject deplObj) { |
| this.deplObj = deplObj; |
| } |
| |
| public void init(File file) { |
| try { |
| FileObject folder = FileUtil.toFileObject(file.getParentFile()); |
| if (folder == null) { |
| ErrorManager.getDefault().log(ErrorManager.INFORMATIONAL, "The parent folder does not exist!"); // NOI18N |
| return; |
| } |
| PrintWriter pw = null; |
| FileLock lock = null; |
| try { |
| String name = file.getName(); |
| FileObject fo = folder.getFileObject(name); |
| if (fo == null) { |
| fo = folder.createData(name); |
| } |
| lock = fo.lock(); |
| pw = new PrintWriter(new OutputStreamWriter(fo.getOutputStream(lock))); |
| pw.println("<MyServer path=\"/mypath\"/>"); // NOI18N |
| } finally { |
| if (pw != null) { |
| pw.close(); |
| } |
| if (lock != null) { |
| lock.releaseLock(); |
| } |
| } |
| } catch (IOException ex) { |
| ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); |
| } |
| |
| // web.xml represented as DDBean model |
| DDBeanRoot root = deplObj.getDDBeanRoot(); |
| if (root != null) { |
| // here we will listen to resource reference changes |
| root.addXpathListener("/web-app/resource-ref", this); // NOI18N |
| } |
| } |
| |
| public String getContextPath() throws ConfigurationException { |
| // TODO: replace this with reading the context path from the server specific DD |
| return "/mypath"; |
| } |
| |
| public void setContextPath(String contextPath) throws ConfigurationException { |
| // TODO: here put the code that will store the context path in the server specific DD |
| } |
| |
| // XpathListener implementation ------------------------------------------- |
| |
| public void fireXpathEvent(XpathEvent xpe) { |
| DDBean eventDDBean = xpe.getBean(); |
| if ("/web-app/resource-ref".equals(eventDDBean.getXpath())) { // NIO18N |
| // new resource reference added |
| if (xpe.isAddEvent()) { |
| String[] name = eventDDBean.getText("res-ref-name"); // NOI18N |
| String[] type = eventDDBean.getText("res-type"); // NOI18N |
| String[] auth = eventDDBean.getText("res-auth"); // NOI18N |
| // TODO: take appropriate steps here |
| } |
| } |
| } |
| |
| // JSR-88 methods --------------------------------------------------------- |
| |
| public DeployableObject getDeployableObject () { |
| return deplObj; |
| } |
| |
| public void save(OutputStream os) throws ConfigurationException { |
| } |
| |
| public DConfigBeanRoot getDConfigBeanRoot (DDBeanRoot dDBeanRoot) |
| throws ConfigurationException { |
| return null; |
| } |
| |
| public void removeDConfigBean (DConfigBeanRoot dConfigBeanRoot) |
| throws BeanNotFoundException { |
| } |
| |
| public void restore (InputStream is) |
| throws ConfigurationException { |
| } |
| |
| public DConfigBeanRoot restoreDConfigBean (InputStream is, DDBeanRoot dDBeanRoot) |
| throws ConfigurationException { |
| return null; |
| } |
| |
| public void saveDConfigBean (OutputStream os, DConfigBeanRoot dConfigBeanRoot) |
| throws ConfigurationException { |
| } |
| }</code></pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_mydeploymentmanager_java"><a class="anchor" href="#_mydeploymentmanager_java"></a>MyDeploymentManager.java</h3> |
| <div class="paragraph"> |
| <p>A dummy implementation of the <code> <a href="https://docs.oracle.com/javaee/1.4/api/javax/enterprise/deploy/spi/DeploymentManager.html">DeploymentManager</a></code> interface, which does nothing more than return <a href="#MyConfiguration"><code>MyConfiguration.java</code> </a>. It is up to you to provide other server-specific implementation features.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Right-click the <code>org.netbeans.modules.j2ee.myserver</code> node and choose New > File/Folder. Under Categories, choose Java Classes. Under File Types, choose Java Class. Click Next and type <code>MyDeploymentManager</code> in Class Name. Click Finish. The new Java class opens in the Source Editor.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Replace the default code with the code below:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package org.netbeans.modules.j2ee.myserver; |
| |
| import java.io.File; |
| import java.io.InputStream; |
| import javax.enterprise.deploy.model.DeployableObject; |
| import javax.enterprise.deploy.shared.DConfigBeanVersionType; |
| import javax.enterprise.deploy.shared.ModuleType; |
| import javax.enterprise.deploy.spi.DeploymentConfiguration; |
| import javax.enterprise.deploy.spi.DeploymentManager; |
| import javax.enterprise.deploy.spi.Target; |
| import javax.enterprise.deploy.spi.TargetModuleID; |
| import javax.enterprise.deploy.spi.exceptions.DConfigBeanVersionUnsupportedException; |
| import javax.enterprise.deploy.spi.exceptions.InvalidModuleException; |
| import javax.enterprise.deploy.spi.exceptions.TargetException; |
| import javax.enterprise.deploy.spi.status.ProgressObject; |
| |
| public class MyDeploymentManager implements DeploymentManager { |
| |
| public ProgressObject [java-layer-method]#distribute(Target[] target, File file, File file2) |
| throws IllegalStateException { |
| return null; |
| } |
| |
| public DeploymentConfiguration [java-layer-method]#createConfiguration(DeployableObject deployableObject) |
| throws InvalidModuleException { |
| return new <<MyConfiguration, ``MyConfiguration`` >>(deployableObject); |
| } |
| |
| public ProgressObject [java-layer-method]#redeploy(TargetModuleID[] targetModuleID, InputStream inputStream, InputStream inputStream2) |
| throws UnsupportedOperationException, IllegalStateException { |
| return null; |
| } |
| |
| public ProgressObject [java-layer-method]#distribute(Target[] target, InputStream inputStream, InputStream inputStream2) |
| throws IllegalStateException { |
| return null; |
| } |
| |
| public ProgressObject [java-layer-method]#undeploy(TargetModuleID[] targetModuleID) throws IllegalStateException { |
| return null; |
| } |
| |
| public ProgressObject [java-layer-method]#stop(TargetModuleID[] targetModuleID) throws IllegalStateException { |
| return null; |
| } |
| |
| public ProgressObject [java-layer-method]#start(TargetModuleID[] targetModuleID) throws IllegalStateException { |
| return null; |
| } |
| |
| public void [java-layer-method]#setLocale(java.util.Locale locale) throws UnsupportedOperationException { |
| } |
| |
| public boolean [java-layer-method]#isLocaleSupported(java.util.Locale locale) { |
| return false; |
| } |
| |
| public TargetModuleID[] [java-layer-method]#getAvailableModules(ModuleType moduleType, Target[] target) |
| throws TargetException, IllegalStateException { |
| return null; |
| } |
| |
| public TargetModuleID[] [java-layer-method]#getNonRunningModules(ModuleType moduleType, Target[] target) |
| throws TargetException, IllegalStateException { |
| return null; |
| } |
| |
| public TargetModuleID[] [java-layer-method]#getRunningModules(ModuleType moduleType, Target[] target) |
| throws TargetException, IllegalStateException { |
| return null; |
| } |
| |
| public ProgressObject [java-layer-method]#redeploy(TargetModuleID[] targetModuleID, File file, File file2) |
| throws UnsupportedOperationException, IllegalStateException { |
| return null; |
| } |
| |
| public void [java-layer-method]#setDConfigBeanVersion(DConfigBeanVersionType dConfigBeanVersionType) |
| throws DConfigBeanVersionUnsupportedException { |
| } |
| |
| public boolean [java-layer-method]#isDConfigBeanVersionSupported(DConfigBeanVersionType dConfigBeanVersionType) { |
| return false; |
| } |
| |
| public void [java-layer-method]#release() { |
| } |
| |
| public boolean [java-layer-method]#isRedeploySupported() { |
| return false; |
| } |
| |
| public java.util.Locale [java-layer-method]#getCurrentLocale() { |
| return null; |
| } |
| |
| public DConfigBeanVersionType [java-layer-method]#getDConfigBeanVersion() { |
| return null; |
| } |
| |
| public java.util.Locale [java-layer-method]#getDefaultLocale() { |
| return null; |
| } |
| |
| public java.util.Locale[] [java-layer-method]#getSupportedLocales() { |
| return null; |
| } |
| |
| public Target[] [java-layer-method]#getTargets() throws IllegalStateException { |
| return null; |
| } |
| }######################</code></pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_myinstantiatingiterator_java"><a class="anchor" href="#_myinstantiatingiterator_java"></a>MyInstantiatingIterator.java</h3> |
| <div class="paragraph"> |
| <p>The <code>MyInstantiatingIterator</code> class is used to create a wizard for registration of the new server in the IDE. The implementation described below lets you specify the display name only. Here, all the other properties are hard coded to keep the implementation as simple as possible.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Notice the URL variable used in the <code>instantiate()</code> method. It is passed to the <code>InstanceProperties.createInstanceProperties()</code> method, which does the actual server registration. The URL parameter is the same as the one used by the <code>DeploymenManager</code> . This way we ensure that our server controls the newly created server instance.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Right-click the <code>org.netbeans.modules.j2ee.myserver</code> node, choose New > Java Class, and type <code>MyInstantiatingIterator</code> in Class Name. Click Finish. The new Java class opens in the Source Editor.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Replace the default code with the code below:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package org.netbeans.modules.j2ee.myserver; |
| |
| import java.awt.Component; |
| import java.awt.Label; |
| import java.io.IOException; |
| import java.util.HashSet; |
| import java.util.Set; |
| import javax.swing.JPanel; |
| import javax.swing.event.ChangeListener; |
| import org.openide.WizardDescriptor; |
| import org.openide.WizardDescriptor.Panel; |
| import org.openide.util.HelpCtx; |
| import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties; |
| import org.openide.DialogDisplayer; |
| import org.openide.ErrorManager; |
| import org.openide.NotifyDescriptor; |
| import org.openide.util.NbBundle; |
| |
| |
| public class MyInstantiatingIterator implements WizardDescriptor.InstantiatingIterator { |
| |
| private final static String PROP_DISPLAY_NAME = "ServInstWizard_displayName"; // NOI18N |
| |
| |
| private InstallPanel panel; |
| private WizardDescriptor wizard; |
| |
| public void removeChangeListener(ChangeListener l) { |
| } |
| |
| public void addChangeListener(ChangeListener l) { |
| } |
| |
| public void uninitialize(WizardDescriptor wizard) { |
| } |
| |
| public void initialize(WizardDescriptor wizard) { |
| this.wizard = wizard; |
| } |
| |
| public void previousPanel() { |
| } |
| |
| public void nextPanel() { |
| } |
| |
| public String name() { |
| return NbBundle.getMessage(MyInstantiatingIterator.class, "MSG_InstallerName"); |
| } |
| |
| public Set instantiate() throws IOException { |
| Set result = new HashSet(); |
| String displayName = getDisplayName(); |
| String url = "deployer:myserver:localhost:8080"; // NOI18N |
| String username = "username"; // NOI18N |
| String password = "password"; // NOI18N |
| try { |
| InstanceProperties ip = InstanceProperties.createInstanceProperties( |
| url, username, password, displayName); |
| result.add(ip); |
| } catch (Exception ex) { |
| DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message( |
| NbBundle.getMessage(MyInstantiatingIterator.class, "MSG_CreateFailed", displayName), |
| NotifyDescriptor.ERROR_MESSAGE)); |
| } |
| return result; |
| } |
| |
| public boolean hasPrevious() { |
| return false; |
| } |
| |
| public boolean hasNext() { |
| return false; |
| } |
| |
| public Panel current() { |
| if (panel == null) { |
| panel = new InstallPanel(); |
| } |
| return panel; |
| } |
| |
| private String getDisplayName() { |
| return (String)wizard.getProperty(PROP_DISPLAY_NAME); |
| } |
| |
| private static class InstallPanel implements WizardDescriptor.Panel { |
| public void removeChangeListener(ChangeListener l) { |
| } |
| |
| public void addChangeListener(ChangeListener l) { |
| } |
| |
| public void storeSettings(Object settings) { |
| } |
| |
| public void readSettings(Object settings) { |
| } |
| |
| public boolean isValid() { |
| return true; |
| } |
| |
| public HelpCtx getHelp() { |
| return HelpCtx.DEFAULT_HELP; |
| } |
| |
| public Component getComponent() { |
| JPanel panel = new JPanel(); |
| panel.add(new Label("< Put your installation form implementation here! >")); // NOI18N |
| return panel; |
| } |
| } |
| }</code></pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_myj2eeplatformimpl_java"><a class="anchor" href="#_myj2eeplatformimpl_java"></a>MyJ2eePlatformImpl.java</h3> |
| <div class="paragraph"> |
| <p>The <code>MyJ2eePlatformImpl</code> class is an implementation of <code> <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/J2eePlatformImpl.html">J2eePlatformImpl</a></code> , which is used to describe the target environment that J2EE applications are built against and subsequently deployed to. It provides a set of server libraries, supported module types, and J2EE specification versions.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Note: Since the current implementation of <code>MyJ2eePlatformImpl.java</code> does not provide the J2EE API libraries, your Web or EJB project will not compile, unless you provide those explicitly in the Libraries panel of the Project Properties dialog box.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Right-click the <code>org.netbeans.modules.j2ee.myserver</code> node, choose New > Java Class, and type <code>MyJ2eePlatformImpl</code> in Class Name. Click Finish. The new Java class opens in the Source Editor.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Replace the default code with the code below:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package org.netbeans.modules.j2ee.myserver; |
| |
| import java.io.File; |
| import java.util.HashSet; |
| import java.util.Set; |
| import org.netbeans.api.java.platform.JavaPlatform; |
| import org.netbeans.api.java.platform.JavaPlatformManager; |
| import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule; |
| import org.netbeans.modules.j2ee.deployment.plugins.api.J2eePlatformImpl; |
| import org.netbeans.spi.project.libraries.LibraryImplementation; |
| |
| import org.openide.util.NbBundle; |
| import org.openide.util.Utilities; |
| |
| public class MyJ2eePlatformImpl extends J2eePlatformImpl { |
| |
| public boolean isToolSupported(String toolName) { |
| return false; |
| } |
| |
| public File[] getToolClasspathEntries(String toolName) { |
| return new File[0]; |
| } |
| |
| public Set getSupportedSpecVersions() { |
| Set result = new HashSet(); |
| result.add(J2eeModule.J2EE_14); |
| //result.add(J2eeModule.JAVA_EE_5); |
| return result; |
| } |
| |
| public java.util.Set getSupportedModuleTypes() { |
| Set result = new HashSet(); |
| result.add(J2eeModule.EAR); |
| result.add(J2eeModule.WAR); |
| result.add(J2eeModule.EJB); |
| return result; |
| } |
| |
| public java.io.File[] getPlatformRoots() { |
| return new File[0]; |
| } |
| |
| public LibraryImplementation[] getLibraries() { |
| return new LibraryImplementation[0]; |
| } |
| |
| public java.awt.Image getIcon() { |
| return Utilities.loadImage("org/netbeans/modules/j2ee/myserver/resources/server.gif"); // NOI18N |
| |
| } |
| |
| public String getDisplayName() { |
| return NbBundle.getMessage(MyJ2eePlatformImpl.class, "MSG_MyServerPlatform"); |
| } |
| |
| public Set getSupportedJavaPlatformVersions() { |
| Set versions = new HashSet(); |
| versions.add("1.4"); // NOI18N |
| versions.add("1.5"); // NOI18N |
| return versions; |
| } |
| |
| public JavaPlatform getJavaPlatform() { |
| return JavaPlatformManager.getDefault().getDefaultPlatform(); |
| } |
| |
| }</code></pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_mystartserver_java"><a class="anchor" href="#_mystartserver_java"></a>MyStartServer.java</h3> |
| <div class="paragraph"> |
| <p>The <code>MyStartServer</code> class is an implementation of the <code> <a href="https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/org/netbeans/modules/j2ee/deployment/plugins/api/StartServer.html">StartServer</a></code> interface. Its purpose is to provide ability to start, stop, and determine the state of the server. The current implementation says that the server is always stopped and it cannot be started. The server-specific implementation is left up to you to complete for the server in question.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Right-click the <code>org.netbeans.modules.j2ee.myserver</code> node, choose New > Java Class, and type <code>MyStartServer</code> in Class Name. Click Finish. The new Java class opens in the Source Editor.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Replace the default code with the code below:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package org.netbeans.modules.j2ee.myserver; |
| |
| import javax.enterprise.deploy.spi.Target; |
| import javax.enterprise.deploy.spi.status.ProgressObject; |
| import org.netbeans.modules.j2ee.deployment.plugins.api.ServerDebugInfo; |
| import org.netbeans.modules.j2ee.deployment.plugins.api.StartServer; |
| |
| public class MyStartServer extends StartServer { |
| |
| public ProgressObject [java-layer-method]#startDebugging(Target target) { |
| return null; |
| } |
| |
| public boolean [java-layer-method]#isDebuggable(Target target) { |
| return false; |
| } |
| |
| public boolean [java-layer-method]#isAlsoTargetServer(Target target) { |
| return true; |
| } |
| |
| public ServerDebugInfo [java-layer-method]#getDebugInfo(Target target) { |
| return null; |
| } |
| |
| public boolean [java-layer-method]#supportsStartDeploymentManager() { |
| return false; |
| } |
| |
| public ProgressObject [java-layer-method]#stopDeploymentManager() { |
| return null; |
| } |
| |
| public ProgressObject [java-layer-method]#startDeploymentManager() { |
| return null; |
| } |
| |
| public boolean [java-layer-method]#needsStartForTargetList() { |
| return false; |
| } |
| |
| public boolean [java-layer-method]#needsStartForConfigure() { |
| return false; |
| } |
| |
| public boolean [java-layer-method]#needsStartForAdminConfig() { |
| return false; |
| } |
| |
| public boolean [java-layer-method]#isRunning() { |
| return false; |
| } |
| }###########</code></pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_myinstancenode_java"><a class="anchor" href="#_myinstancenode_java"></a>MyInstanceNode.java</h3> |
| <div class="paragraph"> |
| <p>The <code>MyInstanceNode</code> class represents instances of the new server type as a node in the Runtime window. A default set of features is added to the node — these features display the server’s status and provide default menu items such as <code>Start</code> , <code>Refresh</code> , and <code>Remove</code> . This is done by a standard filter node that exists on top of the node provided by the module. The <code>MyInstanceNode</code> class defines a dummy customizer implementation which is displayed in the Tools menu’s Server Manager.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Right-click the <code>org.netbeans.modules.j2ee.myserver.nodes</code> node, choose New > Java Class, and type <code>MyInstanceNode</code> in Class Name. Click Finish. The new Java class opens in the Source Editor.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Replace the default code with the code below:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">package org.netbeans.modules.j2ee.myserver.nodes; |
| |
| import java.awt.Component; |
| import java.awt.Label; |
| import javax.swing.JPanel; |
| import org.openide.nodes.AbstractNode; |
| import org.openide.nodes.Children; |
| import org.openide.nodes.Node; |
| import org.openide.util.Lookup; |
| import org.openide.util.NbBundle; |
| |
| public class MyInstanceNode extends AbstractNode implements Node.Cookie { |
| |
| private static String ICON_BASE = "org/netbeans/modules/j2ee/myserver/resources/server.gif"; [java-block-comment]#// NOI18N |
| |
| public MyInstanceNode(Lookup lookup) { |
| super(new Children.Array()); |
| getCookieSet().add(this); |
| setIconBaseWithExtension(ICON_BASE); |
| } |
| |
| public String getDisplayName() { |
| return NbBundle.getMessage(MyInstanceNode.class, "TXT_MyInstanceNode"); |
| } |
| |
| public String getShortDescription() { |
| return "http://localhost:8080"; // NOI18N |
| } |
| |
| public javax.swing.Action[] getActions(boolean context) { |
| return new javax.swing.Action[]{}; |
| } |
| |
| public boolean hasCustomizer() { |
| return true; |
| } |
| |
| public Component getCustomizer() { |
| JPanel panel = new JPanel(); |
| panel.add(new Label("< Put your customizer implementation here! >")); [java-block-comment]#// NOI18N |
| return panel; |
| } |
| }##</code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_setting_up_the_supporting_files"><a class="anchor" href="#_setting_up_the_supporting_files"></a>Setting Up the Supporting Files</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Once you have coded the main files, you must register your module in the <code>layer.xml</code> file and in the <code>nbdep.xml</code> file. You must also define labels and texts you want to display to the user, using the <code>Bundle.properties</code> files.</p> |
| </div> |
| <div class="sect2"> |
| <h3 id="_registering_the_new_server_in_the_netbeans_filesystem"><a class="anchor" href="#_registering_the_new_server_in_the_netbeans_filesystem"></a>Registering the New Server in the NetBeans Filesystem</h3> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Add the following entry between the <code><filesystem></code> tags in the <code>layer.xml</code> file:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"> <folder name="J2EE"> |
| <folder name="DeploymentPlugins"> |
| <folder name="MyServer"> |
| |
| <file name="Descriptor" url="nbdep.xml"/> |
| |
| <file name="Factory.instance"> |
| <attr name="instanceCreate" methodvalue="org.netbeans.modules.j2ee.myserver.MyDeploymentFactory.create"/> |
| <attr name="instanceClass" stringvalue="<<MyDeploymentFactory,org.netbeans.modules.j2ee.myserver.MyDeploymentFactory>>"/> |
| <attr name="instanceOf" stringvalue="javax.enterprise.deploy.spi.factories.DeploymentFactory"/> |
| </file> |
| |
| <file name="RegistryNodeFactory.instance"> |
| <attr name="instanceClass" stringvalue="<<MyRegistryNodeFactory,org.netbeans.modules.j2ee.myserver.nodes.MyRegistryNodeFactory>>"/> |
| <attr name="instanceOf" stringvalue="org.netbeans.modules.j2ee.deployment.plugins.api.RegistryNodeFactory"/> |
| </file> |
| |
| <file name="J2eePlatformFactory.instance"> |
| <attr name="instanceCreate" newvalue="org.netbeans.modules.j2ee.myserver.MyJ2eePlatformFactory"/> |
| <attr name="instanceClass" stringvalue="<<MyJ2eePlatformFactory,org.netbeans.modules.j2ee.myserver.MyJ2eePlatformFactory>>"/> |
| <attr name="instanceOf" stringvalue="org.netbeans.modules.j2ee.deployment.plugins.api.J2eePlatformFactory"/> |
| </file> |
| |
| <file name="OptionalFactory.instance"> |
| <attr name="instanceCreate" newvalue="org.netbeans.modules.j2ee.myserver.MyOptionalFactory"/> |
| <attr name="instanceClass" stringvalue="<<MyOptionalFactory,org.netbeans.modules.j2ee.myserver.MyOptionalFactory>>"/> |
| <attr name="instanceOf" stringvalue="org.netbeans.modules.j2ee.deployment.plugins.api.OptionalDeploymentManagerFactory"/> |
| </file> |
| |
| <file name="ConfigurationSupportImpl.instance"> |
| <attr name="instanceCreate" newvalue="<<ConfigurationSupportImpl,org.netbeans.modules.j2ee.myserver.ConfigurationSupportImpl>>"/> |
| <attr name="instanceOf" stringvalue="org.netbeans.modules.j2ee.deployment.plugins.api.ConfigurationSupport"/> |
| </file> |
| |
| <folder name="DeploymentFileNames"> |
| <folder name="WAR"> |
| <file name="WEB-INF\myserver-web.xml"/> |
| </folder> |
| </folder> |
| |
| </folder> |
| </folder> |
| |
| </folder></code></pre> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Right-click <code>org.netbeans.modules.j2ee.myserver.resources</code> and choose New > File/Folder. Under categories, select XML. Under File Types, select XML Document. Click Next. Type <code>nbdep</code> in File Name, click Next and then click Finish. Replace the content of <code>nbdep.xml</code> with the following code:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"> <netbeans-deployment> |
| |
| <!-- |
| The icon element contains a path to the icon to be used to present the server |
| in the server registry. |
| --> |
| <icon>org/netbeans/modules/j2ee/myserver/resources/server</icon> |
| |
| <!-- |
| The disconnected-string element contains the String parameter to DeploymentFactory.getDisconnectedDeploymentManager() |
| --> |
| <disconnected-string>deployer:myserver</disconnected-string> |
| |
| <!-- |
| The container-limitation element modifies a plugin to say that not all j2ee deployments are valid. |
| For example, a web-only server would include |
| <container-limitation> <war-deploy/> </container-limitation> |
| to indicate that only war deployments are accepted. |
| If a container-limitation element is not present, all j2ee deployments are assumed valid. |
| If a container-limitation element is present, then only j2ee deployment types explicitly |
| mentioned are allowed. |
| --> |
| <container-limitation> |
| <ear-deploy/> |
| <war-deploy/> |
| <ejbjar-deploy/> |
| </container-limitation> |
| |
| <web-context-root> |
| <xpath>/</xpath> |
| <prop-name>contextRoot</prop-name> |
| </web-context-root> |
| |
| </netbeans-deployment></code></pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_localizing_the_module"><a class="anchor" href="#_localizing_the_module"></a>Localizing the module</h3> |
| <div class="paragraph"> |
| <p>The module is localized using <code>Bundle.properties</code> files. A <code>Bundle.properties</code> file provides language-specific strings for the user interface provided by other files in the package. When you used the New Project wizard to create the module, the IDE created a <code>Bundle.properties</code> file in the <code>org.netbeans.modules.j2ee.myserver.resources</code> package. Now you will add <code>key=value</code> pairs to the IDE-generated <code>Bundle.properties</code> file and create two additional <code>Bundle.properties</code> files for the other packages.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>In <code>org.netbeans.modules.j2ee.myserver.resources</code> , add the following properties to the <code>Bundle.properties</code> file:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">OpenIDE-Module-Name=My Server Module |
| OpenIDE-Module-Display-Category=J2EE |
| OpenIDE-Module-Short-Description=My Server Module |
| OpenIDE-Module-Long-Description=My Server Module</code></pre> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Right-click <code>org.netbeans.modules.j2ee.myserver</code> and choose New > File/Folder. Under Categories, select Other. Under File Types, select Properties File. Click Next. Type <code>Bundle</code> in File Name and then click Finish. Add the following properties to the <code>Bundle.properties</code> file:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">TXT_DisplayName=My Server |
| MSG_InstallerName=My Server Installer |
| MSG_CreateFailed=Cannot create {0} server instance. |
| MSG_MyServerPlatform=My Server Platform</code></pre> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="3"> |
| <li> |
| <p>Create another <code>Bundle.properties</code> file in the <code>org.netbeans.modules.j2ee.myserver.nodes</code> package, and add the following properties to it:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">TXT_MyInstanceNode=My Server Instance |
| TXT_MyTargetNode=My Target Instance</code></pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_getting_the_icon"><a class="anchor" href="#_getting_the_icon"></a>Getting the Icon</h3> |
| <div class="paragraph"> |
| <p>Make sure that you have a 16x16 icon named <code>server.gif</code> in the <code>org.netbeans.modules.j2ee.myserver.resources</code> package. For example, you can find some 16x16 icons at the following location within the IDE’s installation directory:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">enterprise3\jakarta-tomcat-5.5.17\server\webapps\admin\images</code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_building_and_installing_the_module"><a class="anchor" href="#_building_and_installing_the_module"></a>Building and Installing the Module</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>The IDE uses an Ant build script to build and install your module. The build script is created for you when you create the module project.</p> |
| </div> |
| <div class="sect2"> |
| <h3 id="_installing_the_server_skeleton_module"><a class="anchor" href="#_installing_the_server_skeleton_module"></a>Installing the Server-Skeleton Module</h3> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>In the Projects window, right-click the <code>My Server Module</code> project and choose Install/Reload in Target Platform.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>The module is built and installed in the target IDE or Platform. The target IDE or Platform opens so that you can try out your new module. The default target IDE or Platform is the installation used by the current instance of the development IDE. Note that when you run your module, you will be using a temporary test user directory, not the development IDE’s user directory.</p> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="_using_the_server_skeleton_module"><a class="anchor" href="#_using_the_server_skeleton_module"></a>Using the Server-Skeleton Module</h3> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Choose Tools > Server Manager, click Add Server and notice that a new server is available:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/myserver_choose-server.png" alt="myserver choose server"> |
| </div> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Use the module as described in <a href="#introducing-sample">Introducing the Sample</a>.</p> |
| </li> |
| </ol> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_adding_server_specific_code"><a class="anchor" href="#_adding_server_specific_code"></a>Adding Server-Specific Code</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Before adding server-specific code, have a look at how others have done it.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="1"> |
| <li> |
| <p>Download the open-source server modules for JBoss, WebLogic, and WebSphere, following the instructions found on the <a href="http://serverplugins.netbeans.org/">Server Plugins Project</a> page.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="2"> |
| <li> |
| <p>Open the sources of one or more of the downloaded server modules in the IDE and browse through them. For example, if you open the sources of the JBoss module, the Projects window looks as follows:</p> |
| </li> |
| </ol> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="../../_images/tutorials/myserver_jboss-server.png" alt="myserver jboss server"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Note that in the illustration above, the selected files are those that are discussed in this tutorial.</p> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="3"> |
| <li> |
| <p>Examine the sources, using this tutorial and the <a href="https://bits.netbeans.org/dev/javadoc/">NetBeans API List (Current Development Version)</a> to help you.</p> |
| </li> |
| </ol> |
| </div> |
| <div class="paragraph"> |
| <p>Here are some j2eeserver API classes worth looking at:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><strong>IncrementalDeployment.</strong> This interface allows modules to use incremental deployment instead of the standard JSR-88 deployment.</p> |
| </li> |
| <li> |
| <p><strong>UISupport.</strong> This class provides support for showing the server output in the Output window along with the toolbar with the server state management actions.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="olist arabic"> |
| <ol class="arabic" start="4"> |
| <li> |
| <p>Create your own server module!</p> |
| </li> |
| </ol> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_next_steps"><a class="anchor" href="#_next_steps"></a>Next Steps</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>For more information about creating and developing NetBeans modules, see the following resources:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><a href="../../kb/" class="xref page">Tutorials</a></p> |
| </li> |
| <li> |
| <p><a href="https://bits.netbeans.org/dev/javadoc/">NetBeans API List (Current Development Version)</a></p> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="_versioning_and_known_issues_in_this_tutorial"><a class="anchor" href="#_versioning_and_known_issues_in_this_tutorial"></a>Versioning and Known Issues in this Tutorial</h2> |
| <div class="sectionbody"> |
| <table class="tableblock frame-all grid-all stretch"> |
| <colgroup> |
| <col style="width: 33.3333%;"> |
| <col style="width: 33.3333%;"> |
| <col style="width: 33.3334%;"> |
| </colgroup> |
| <thead> |
| <tr> |
| <th class="tableblock halign-left valign-top"><strong>Version</strong></th> |
| <th class="tableblock halign-left valign-top"><strong>Date</strong></th> |
| <th class="tableblock halign-left valign-top"><strong>Changes</strong></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">25 June 2005</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Initial version</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">2</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">4 July 2006</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Updated for NetBeans IDE 5.5, using diff from Stepan Herold. Also: changed the download to the new module, changed all screenshots, changed instances of "plugin" and "plug-in", where relevant to "module", cleaned up a lot.</p> |
| <p class="tableblock">Following files are new or have undergone change for 5.5:</p> |
| <p class="tableblock">* New: ConfigurationSupportImpl.java and MyConfiguration.java |
| * Deleted: DeploymentPlanSplitter.java |
| * Changed: MyDeploymentManager.java, MyJ2eePlatformImpl.java, MyInstanceNode.java, layer.xml, project.xml</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">3</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">10 August 2006</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">* Changed forward slash to backward slash in <code>layer.xml</code> |
| * Added period at end of his paragraph…​</p></td> |
| </tr> |
| </tbody> |
| </table> |
| <table class="tableblock frame-all grid-all stretch"> |
| <colgroup> |
| <col style="width: 33.3333%;"> |
| <col style="width: 33.3333%;"> |
| <col style="width: 33.3334%;"> |
| </colgroup> |
| <thead> |
| <tr> |
| <th class="tableblock halign-left valign-top"><strong>Issue Number</strong></th> |
| <th class="tableblock halign-left valign-top"><strong>Description</strong></th> |
| <th class="tableblock halign-left valign-top"><strong>Status</strong></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">1</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Code and tutorial itself need to be reviewed. Code needs to be tested on multiple platforms. (Created on Windows XP, tested nowhere else yet. Tried to avoid potential problems by avoiding spaces in names, etc.)</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Done.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">2</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Tutorial needs to be updated once Phase III and IV are complete.</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Done.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">3</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Some APIs used in this tutorial have deprecated methods. This will produce errors in the Output window, but should not impact functioning of module.</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Fixed.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">4</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">JSR 88 is helpful in understanding this module. However, this JSR not yet been referred to in this tutorial.</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">To be fixed.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">5</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Javadoc links not yet provided for all classes and methods used in this module, although most have been done already.</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">To be fixed.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">6</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Open questions, specific to version 2 of this tutorial:</p> |
| <p class="tableblock">* How to make the server skeleton support Java EE 5? (Annotations, no deployment descriptors?) |
| * Previous version was possible to select Start/Stop/etc. Why not anymore? |
| * Migration path? |
| * Why no more deploymentplansplitter? |
| * Why now deployment descriptor goes to WEB-INF instead of META-INF? |
| * Why has DeploymentFileNames in layer.xml moved? |
| * Picture of JBoss at end to be changed too (does it use MyConfiguration.java, etc?</p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">To be answered.</p></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <section class='tools'> |
| <ul class="menu align-center"> |
| <li><a title="Facebook" href="https://www.facebook.com/NetBeans"><i class="fa fa-md fa-facebook"></i></a></li> |
| <li><a title="Twitter" href="https://twitter.com/netbeans"><i class="fa fa-md fa-twitter"></i></a></li> |
| <li><a title="Github" href="https://github.com/apache/netbeans"><i class="fa fa-md fa-github"></i></a></li> |
| <li><a title="YouTube" href="https://www.youtube.com/user/netbeansvideos"><i class="fa fa-md fa-youtube"></i></a></li> |
| <li><a title="Atom Feed" href="https://netbeans.apache.org/blogs/atom"><i class="fa fa-mf fa-rss"></i></a></li> |
| <li><a title="Slack" href="https://tinyurl.com/netbeans-slack-signup/"><i class="fa fa-md fa-slack"></i></a></li> |
| <li><a title="Issues" href="https://github.com/apache/netbeans/issues"><i class="fa fa-mf fa-bug"></i></a></li> |
| </ul> |
| <ul class="menu align-center"> |
| <li><a href="https://github.com/apache/netbeans-antora-tutorials/edit/main/modules/ROOT/pages/tutorials/nbm-server-plugin.adoc" title="See this page in github"><i class="fa fa-md fa-edit"></i> See this page in GitHub.</a></li> |
| </ul> |
| </section> |
| </div> |
| <div class='grid-container incubator-area' style='margin-top: 64px'> |
| <div class='grid-x grid-padding-x'> |
| <div class='large-auto cell text-center'> |
| <a href="https://www.apache.org/"> |
| <img style="height: 60px" title="Apache Software Foundation" src="../../../../_/images/asf_logo_wide.svg" /> |
| </a> |
| </div> |
| <div class='large-auto cell text-center'> |
| <a href="https://www.apache.org/events/current-event.html"> |
| <img style="width:234px; height: 60px;" title="Apache Software Foundation current event" src="https://www.apache.org/events/current-event-234x60.png"/> |
| </a> |
| </div> |
| </div> |
| </div> |
| <footer> |
| <div class="grid-container"> |
| <div class="grid-x grid-padding-x"> |
| <div class="large-auto cell"> |
| <h1><a href="../../../../front/main/about">About</a></h1> |
| <ul> |
| <li><a href="../../../../front/main/community/who">Who's Who</a></li> |
| <li><a href="https://www.apache.org/foundation/thanks.html">Thanks</a></li> |
| <li><a href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li> |
| <li><a href="https://www.apache.org/security/">Security</a></li> |
| </ul> |
| </div> |
| <div class="large-auto cell"> |
| <h1><a href="../../../../front/main/community">Community</a></h1> |
| <ul> |
| <li><a href="../../../../front/main/community/mailing-lists">Mailing lists</a></li> |
| <li><a href="../../../../front/main/community/committer">Becoming a committer</a></li> |
| <li><a href="../../../../front/main/community/events">NetBeans Events</a></li> |
| <li><a href="https://www.apache.org/events/current-event.html">Apache Events</a></li> |
| </ul> |
| </div> |
| <div class="large-auto cell"> |
| <h1><a href="../../../../front/main/participate">Participate</a></h1> |
| <ul> |
| <li><a href="../../../../front/main/participate/submit-pr">Submitting Pull Requests</a></li> |
| <li><a href="../../../../front/main/participate/report-issue">Reporting Issues</a></li> |
| <li><a href="../../../../front/main/participate/#documentation">Improving the documentation</a></li> |
| </ul> |
| </div> |
| <div class="large-auto cell"> |
| <h1><a href="../../../../front/main/help">Get Help</a></h1> |
| <ul> |
| <li><a href="../../../../front/main/help/#documentation">Documentation</a></li> |
| <li><a href="../../../../wiki/main/wiki">Wiki</a></li> |
| <li><a href="../../../../front/main/help/#support">Community Support</a></li> |
| <li><a href="../../../../front/main/help/commercial-support">Commercial Support</a></li> |
| </ul> |
| </div> |
| <div class="large-auto cell"> |
| <h1><a href="../../../../front/main/download">Download</a></h1> |
| <ul> |
| <li><a href="../../../../front/main/download">Releases</a></li> |
| <li><a href="https://plugins.netbeans.apache.org/">Plugins</a></li> |
| <li><a href="../../../../front/main/download/#_daily_builds_and_building_from_source">Building from source</a></li> |
| <li><a href="../../../../front/main/download/#_older_releases">Previous releases</a></li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| </footer> |
| <div class='footer-disclaimer'> |
| <div class="footer-disclaimer-content"> |
| <p>Copyright © 2017-2025 <a href="https://www.apache.org">The Apache Software Foundation</a>.</p> |
| <p>Licensed under the Apache <a href="https://www.apache.org/licenses/">license</a>, version 2.0</p> |
| <div style='max-width: 40em; margin: 0 auto'> |
| <p>Apache, Apache NetBeans, NetBeans, the Apache feather logo and the Apache NetBeans logo are trademarks of <a href="https://www.apache.org">The Apache Software Foundation</a>.</p> |
| <p>Oracle and Java are registered trademarks of Oracle and/or its affiliates.</p> |
| <p>The Apache NetBeans website conforms to the <a href="https://privacy.apache.org/policies/privacy-policy-public.html">Apache Software Foundation Privacy Policy</a></p> |
| </div> |
| </div> |
| </div> |
| |
| |
| <script src="../../../../_/js/vendor/lunr.js"></script> |
| <script src="../../../../_/js/search-ui.js" id="search-ui-script" data-site-root-path="../../../.." data-snippet-length="100" data-stylesheet="../../../../_/css/search.css"></script> |
| <script async src="../../../../search-index.js"></script> |
| <script src="../../../../_/js/vendor/jquery.min.js"></script> |
| <script src="../../../../_/js/vendor/what-input.min.js"></script> |
| <script src="../../../../_/js/vendor/foundation.min.js"></script> |
| <script src="../../../../_/js/vendor/jquery.colorbox-min.js"></script> |
| <script src="../../../../_/js/netbeans.js"></script> |
| <script> |
| $(function(){ $(document).foundation(); }); |
| </script> |
| <script src="../../../../_/js/vendor/highlight.min.js"></script> |
| <script> |
| document.addEventListener('DOMContentLoaded', (event) => { |
| document.querySelectorAll('pre code').forEach((el) => { |
| hljs.highlightElement(el); |
| }); |
| }); |
| </script> |
| </body> |
| </html> |