You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2015/07/01 19:06:45 UTC
svn commit: r1688692 [24/30] - in
/karaf/site/production/manual/latest-3.0.x: ./ commands/ css/ css/scalate/
developers-guide/ images/ users-guide/
Added: karaf/site/production/manual/latest-3.0.x/users-guide/instances.html
URL: http://svn.apache.org/viewvc/karaf/site/production/manual/latest-3.0.x/users-guide/instances.html?rev=1688692&view=auto
==============================================================================
--- karaf/site/production/manual/latest-3.0.x/users-guide/instances.html (added)
+++ karaf/site/production/manual/latest-3.0.x/users-guide/instances.html Wed Jul 1 17:06:42 2015
@@ -0,0 +1,294 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
+<html lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <meta name="description" content="description goes here"/>
+ <meta name="keywords" content="keywords,goes,here"/>
+ <meta name="author" content="The Apache Karaf Team"/>
+ <link href="../css/style.css" rel="stylesheet" type="text/css"/>
+ <link href="../css/pygmentize.css" rel="stylesheet" type="text/css"/>
+ <title>
+ Apache Karaf 3.0.5-SNAPSHOT Guides
+ </title>
+ </head>
+ <body>
+ <table width="100%" cellpadding="0" cellspacing="0">
+ <tr width="100%">
+ <td id="cell-0-0" colspan="2">
+
+ </td>
+ <td id="cell-0-1">
+
+ </td>
+ <td id="cell-0-2" colspan="2">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-1-0">
+
+ </td>
+ <td id="cell-1-1">
+
+ </td>
+ <td id="cell-1-2">
+ <div style="padding: 5px;">
+ <div id="banner">
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td align="left" class="topbardiv" nowrap="">
+<a href="http://karaf.apache.org/" title="A server side OSGi distribution">
+ <img border="0" src="../images/karaf-logo.png" width="400px"></img>
+</a>
+ </td>
+ <td align="right" nowrap="">
+<a href="http://www.apache.org/" title="The Apache Sofware Foundation">
+ <img border="0" src="../images/asf-logo.png">
+</a>
+ </td>
+ </tr>
+ </table>
+
+ </div>
+ <div id="top-menu">
+ <table border="0" cellpadding="1" cellspacing="0" width="100%">
+ <tr>
+ <td>
+ <div align="left"></div>
+ </td>
+ <td>
+ <div align="right">
+ <p>
+<a href="../index.html" title="Home">Home</a>
+|
+<a href="index.html" title="Users Guide">Users Guide</a>
+|
+<a href="../developers-guide/index.html" title="Developers Guide">Developers Guide</a>
+</p>
+
+
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </td>
+ <td id="cell-1-3">
+
+ </td>
+ <td id="cell-1-4">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-2-0" colspan="2">
+
+ </td>
+ <td id="cell-2-1">
+ <table>
+ <tr height="100%" valign="top">
+ <td height="100%">
+ <div id="wrapper-menu-page-right">
+ <div id="wrapper-menu-page-top">
+ <div id="wrapper-menu-page-bottom">
+ <div id="menu-page">
+ <h3 id="Homeindex"><a href="../index.html">Home</a></h3><ul style="list-style: square"><li><a href="../overview.html">Overview</a></li><li><a href="../quick-start.html">Quick Start</a></li></ul><h3 id="UsersGuideusersguideindex"><a href="index.html">Users Guide</a></h3><ul style="list-style: square"><li><a href="installation.html">Installation</a></li><li><a href="directory-structure.html">Directory structure</a></li><li><a href="start-stop.html">Start, stop, restart, connect</a></li><li><a href="wrapper.html">Integration in the operating system: the Service Wrapper</a></li><li><a href="console.html">Console</a></li><li><a href="remote.html">Remote</a></li><li><a href="log.html">Log</a></li><li><a href="configuration.html">Configuration</a></li><li><a href="urls.html">Artifacts repositories and URLs</a></li><li><a href="provisioning.html">Provisioning and features</a></li><li><a href="deployers.html">Deployers</a></li><li><a href="kar.html">KAR</a></li><li><a
href="instances.html">Instances</a></li><li><a href="security.html">Security</a></li><li><a href="obr.html">OBR</a></li><li><a href="enterprise.html">Enterprise</a><ul><li><a href="webcontainer.html">WebContainer (JSP/Servlet)</a></li><li><a href="jndi.html">Naming (JNDI)</a></li><li><a href="jta.html">Transaction (JTA)</a></li><li><a href="jdbc.html">DataSource (JDBC)</a></li><li><a href="jms.html">MOM (JMS)</a></li><li><a href="jpa.html">Persistence (JPA)</a></li><li><a href="ejb.html">EJB</a></li><li><a href="cdi.html">CDI</a></li><li><a href="failover.html">HA/failover and cluster</a></li></ul></li><li><a href="monitoring.html">Monitoring and Management using JMX</a></li><li><a href="webconsole.html">WebConsole</a></li><li><a href="tuning.html">Tuning</a></li></ul><h3 id="DevelopersGuidedevelopersguideindex"><a href="../developers-guide/index.html">Developers Guide</a></h3><ul style="list-style: square"><li><a href="../developers-guide/developer-commands.html">Developer command
s</a></li><li><a href="../developers-guide/scripting.html">Scripting</a></li><li><a href="../developers-guide/connect.html">Programmatically connect</a></li><li><a href="../developers-guide/branding.html">Branding</a></li><li><a href="../developers-guide/extending.html">Extending</a></li><li><a href="../developers-guide/karaf-maven-plugin.html">Karaf Maven plugin</a></li><li><a href="../developers-guide/custom-distribution.html">Custom distribution</a></li><li><a href="../developers-guide/services.html">OSGi services</a></li><li><a href="../developers-guide/creating-bundles.html">Create OSGi bundle</a></li><li><a href="../developers-guide/blueprint.html">Blueprint</a></li><li><a href="../developers-guide/cdi.html">CDI</a></li><li><a href="../developers-guide/archetypes.html">Maven Archetypes</a></li><li><a href="../developers-guide/security-framework.html">Security Framework</a></li><li><a href="../developers-guide/debugging.html">Troubleshooting, Debugging, Profiling</a></li><li><a
href="../developers-guide/writing-tests.html">Integration testing</a></li><li><a href="../developers-guide/github-contributions.html">Github Contributions</a></li></ul><h3 id="Commandscommandscommands"><a href="../commands/commands.html">Commands</a></h3>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ <td height="100%" width="100%">
+ <div class="wiki-content">
+<h1 id="Instances">Instances</h1><p>A instance is a complete new Apache Karaf runtime, isolated from the other ones.</p><p>The purpose is to easily create and manage a new Apache Karaf runtime without installing a complete distribution.</p><p>A instance is a new instance that you can launch separately from the root one, and deploy applications into. It means that each instance is run on a different JVM.</p><p>A instance does not contain a full copy of the Apache Karaf distribution, but only a set of the configuration files and data folder which contains all the runtime information, logs and temporary files.</p><h2 id="Usingtheinstancecommands">Using the instance commands</h2><p>The <strong>instance</strong> commands allow you to create and manage instances.</p> <h3 id="Creatinginstances">Creating instances</h3><p>You create a new runtime instance by typing <a href="../commands/instance-create.html"><tt>instance:create</tt></a> in the Karaf console.</p><p>As shown in the following ex
ample, <tt>instance:create</tt> causes the runtime to create a new runtime installation in the active runtime's {{instances/<a href="name.html">name</a>} directory. The new instance is a new Karaf instance and is assigned an SSH port number based on an incremental count starting at 8101 and a RMI registry port number based on an incremental count starting at 1099.</p><pre>
+karaf@root()> instance:create test
+</pre><p>The new instance is fresh Apache Karaf instance. It uses default configuration files set, as you install a fresh Karaf distribution.</p><p>You can enable the verbose mode for the <tt>instance:create</tt> command using the <tt>-v</tt> option:</p><pre>
+karaf@root()> instance:create -v test
+Creating new instance on SSH port 8103 and registry port 1101 / RMI server port 44446 at: /opt/karaf/instances/test
+Creating dir: /opt/karaf/instances/test/bin
+Creating dir: /opt/karaf/instances/test/etc
+Creating dir: /opt/karaf/instances/test/system
+Creating dir: /opt/karaf/instances/test/deploy
+Creating dir: /opt/karaf/instances/test/data
+Creating file: /opt/karaf/instances/test/etc/config.properties
+Creating file: /opt/karaf/instances/test/etc/jre.properties
+Creating file: /opt/karaf/instances/test/etc/custom.properties
+Creating file: /opt/karaf/instances/test/etc/java.util.logging.properties
+Creating file: /opt/karaf/instances/test/etc/org.apache.felix.fileinstall-deploy.cfg
+Creating file: /opt/karaf/instances/test/etc/org.apache.karaf.features.obr.cfg
+Creating file: /opt/karaf/instances/test/etc/org.apache.karaf.features.repos.cfg
+Creating file: /opt/karaf/instances/test/etc/org.apache.karaf.log.cfg
+Creating file: /opt/karaf/instances/test/etc/org.ops4j.pax.logging.cfg
+Creating file: /opt/karaf/instances/test/etc/org.ops4j.pax.url.mvn.cfg
+Creating file: /opt/karaf/instances/test/etc/users.properties
+Creating file: /opt/karaf/instances/test/etc/keys.properties
+Creating file: /opt/karaf/instances/test/etc/org.apache.karaf.features.cfg
+Creating file: /opt/karaf/instances/test/etc/system.properties
+Creating file: /opt/karaf/instances/test/etc/org.apache.karaf.shell.cfg
+Creating file: /opt/karaf/instances/test/etc/org.apache.karaf.management.cfg
+Creating file: /opt/karaf/instances/test/bin/karaf
+Creating file: /opt/karaf/instances/test/bin/start
+Creating file: /opt/karaf/instances/test/bin/stop
+</pre><p>You can manually configure the different ports, the location of the instance, the Apache Karaf features URLs using different options of the <tt>instance:create</tt> command.<br/>You can have details about these options using the <tt>--help</tt> option.</p><h3 id="Cloninganinstance">Cloning an instance</h3><p>Instead of creating a fresh instance, you can clone an existing instance using <tt>instance:clone</tt>.</p><p>The <tt>instance:clone</tt> command reuse the files from the source instance:</p><pre>
+karaf@root()> instance:clone root test
+</pre><p>You can have details about the cloning options using the <tt>--help</tt> option.</p><h3 id="Changingtheinstancelocation">Changing the instance location</h3><p>By default, the new instances storage is in the <tt>KARAF_HOME/instance</tt> directory.<br/>You find a directory with the name of the instance storing the different instance files.</p><p>You can change the location of the instance using the <tt>-l</tt> option to the <tt>instance:create</tt> and <tt>instance:clone</tt> commands:</p><pre>
+karaf@root()> instance:create -v -l /tmp/test test
+Creating new instance on SSH port 8102 and registry port 1100 / RMI server port 44445 at: /tmp/test
+Creating dir: /tmp/test/bin
+Creating dir: /tmp/test/etc
+Creating dir: /tmp/test/system
+Creating dir: /tmp/test/deploy
+Creating dir: /tmp/test/data
+Creating file: /tmp/test/etc/config.properties
+Creating file: /tmp/test/etc/jre.properties
+Creating file: /tmp/test/etc/custom.properties
+Creating file: /tmp/test/etc/java.util.logging.properties
+Creating file: /tmp/test/etc/org.apache.felix.fileinstall-deploy.cfg
+Creating file: /tmp/test/etc/org.apache.karaf.features.obr.cfg
+Creating file: /tmp/test/etc/org.apache.karaf.features.repos.cfg
+Creating file: /tmp/test/etc/org.apache.karaf.log.cfg
+Creating file: /tmp/test/etc/org.ops4j.pax.logging.cfg
+Creating file: /tmp/test/etc/org.ops4j.pax.url.mvn.cfg
+Creating file: /tmp/test/etc/users.properties
+Creating file: /tmp/test/etc/keys.properties
+Creating file: /tmp/test/etc/org.apache.karaf.features.cfg
+Creating file: /tmp/test/etc/system.properties
+Creating file: /tmp/test/etc/org.apache.karaf.shell.cfg
+Creating file: /tmp/test/etc/org.apache.karaf.management.cfg
+Creating file: /tmp/test/bin/karaf
+Creating file: /tmp/test/bin/start
+Creating file: /tmp/test/bin/stop
+</pre><p>Careful, it's not possible to change the location of an instance once it has been created.</p><p>NB: <tt>instance:destroy</tt> will remove the instance location for you. You don't have to remove the instance location "by hand".</p><h3 id="Changinginstanceports">Changing instance ports</h3><p>You can change the SSH port number assigned to an instance using the <tt>instance:ssh-port-change</tt> command:</p><pre>
+karaf@root()> instance:ssh-port-change test 8104
+</pre><p>where test is the instance name and 8104 is the new SSH port number to use for the test instance.</p><p>You can change the RMI Registry port number (used by JMX) of an instance using the <tt>instance:rmi-registry-port-change</tt> command:</p><pre>
+karaf@root()> instance:rmi-registry-port-change test 1102
+</pre><p>where test is the instance name and 1102 is the new RMI Registry port number to use for the test instance.</p><p>You can also change the RMI Server port number (used by JMX too) of an instance using the <tt>instance:rmi-server-port-change</tt> command:</p><pre>
+karaf@root()> instance:rmi-server-port-change test 44447
+</pre><p>where test is the instance name and 44447 is the new RMI Server port number to use for the test instance.</p><p>NB: the instance has to be stopped to be able to change the port numbers.</p><h3 id="Startinginstances">Starting instances</h3><p>New instances are created in a stopped state.</p><p>To start an instance, you can use the <tt>instance:start</tt> command:</p><pre>
+karaf@root()> instance:start test
+</pre><p>where test is the instance name.</p><h3 id="Listinginstances">Listing instances</h3><p>To list the instances and their current status, you can use the <tt>instance:list</tt> command:</p><pre>
+karaf@root()> instance:list
+SSH Port | RMI Registry | RMI Server | State | PID | Name
+-------------------------------------------------------------
+ 8101 | 1099 | 44444 | Started | 19652 | root
+ 8104 | 1101 | 44446 | Stopped | 0 | test
+</pre><p>An instance can be in the following status:</p><ul style="list-style: square"><li>Stopped: the instance is stopped.</li><li>Starting: the instance is starting.</li><li>Started: the instance is up and running. You can connect and use it.</li></ul><h3 id="Statusofaninstance">Status of an instance</h3><p>You can get directly the status of a given instance using the <tt>instance:status</tt> command:</p><pre>
+karaf@root()> instance:status test
+Started
+</pre><p>where test is the instance name.</p><h3 id="Connectingtoaninstance">Connecting to an instance</h3><p>You can connect to a running instance directly from the root one using the <tt>instance:connect</tt> command:</p><pre>
+karaf@root()> instance:connect test
+</pre><p>where 'test' is the instance name where to connect to.</p><p>By default, this command will use the same username used on the root instance, and the password will be prompted.</p><p>You can use a different username using the <tt>-u</tt> or <tt>--username</tt> option. You can also provide the password using the<br/><tt>-p</tt> or <tt>--password</tt> option.</p><p>If you don't provide any argument, you will logon on the instance:</p><pre>
+karaf@test()>
+</pre><p>Note the name of instance in the shell prompt (@test).</p><p>You can logoff from the instance and return back to the root instance using the <tt>logout</tt> command or CTRL-D key binding:</p><pre>
+karaf@test()> logout
+karaf@root()>
+</pre><p>The <tt>instance:connect</tt> command accepts shell commands as argument. It allows you to directly execute commands or scripts on the instance:</p><pre>
+karaf@root()> instance:connect test feature:list
+Name | Version | Installed | Repository | Description
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+standard | 3.0.0 | x | standard-3.0.0 | Karaf standard feature
+aries-annotation | 3.0.0 | | standard-3.0.0 | Aries Annotations
+wrapper | 3.0.0 | | standard-3.0.0 | Provide OS integration
+service-wrapper | 3.0.0 | | standard-3.0.0 | Provide OS integration (alias to wrapper feature)
+obr | 3.0.0 | | standard-3.0.0 | Provide OSGi Bundle Repository (OBR) support
+config | 3.0.0 | x | standard-3.0.0 | Provide OSGi ConfigAdmin support
+region | 3.0.0 | x | standard-3.0.0 | Provide Region Support
+...
+</pre><h3 id="Stopaninstance">Stop an instance</h3><p>To stop an instance, you can connect to the instance (using <tt>instance:connect</tt>) and execute the <tt>system:shutdown</tt><br/>command.</p><p>You can also use the <a href="../commands/instance-stop.html"><tt>instance:stop</tt></a> command:</p><pre>
+karaf@root()> instance:stop test
+</pre><p>where test is the instance name.</p><p>The instance will go to the "Stopped" state.</p><h3 id="Destroyaninstance">Destroy an instance</h3><p>You can completely delete a stopped instance using the <tt>instance:destroy</tt> command:</p><pre>
+karaf@root()> instance:destroy test
+</pre><p>where test is the instance name.</p><p>NB: the <tt>instance:destroy</tt> deletes the instance store (the location where the instance files are stored).</p><h3 id="Renameaninstance">Rename an instance</h3><p>You can change the name of a stopped instance using the <tt>instance:rename</tt> command:</p><pre>
+karaf@root()> instance:rename test newTest
+</pre><p>where test is the current instance name, and newTest the new instance name.</p><h2 id="Instancescript">Instance script</h2><p>The <tt>instance:*</tt> commands require the root instance running.</p><p>But, you can also administrate directly instances without the root instance, using the <tt>bin/instance</tt> Unix script<br/>(or <tt>bin/instance.bat</tt> script on Windows).</p><p>You find the same actions that you can do with the <tt>instance:*</tt> commands in the <tt>instance<a href=".bat">.bat</a></tt> script:</p><pre>
+bin/instance
+Available commands:
+ clone - Clones an existing container instance.
+ create - Creates a new container instance.
+ destroy - Destroys an existing container instance.
+ list - Lists all existing container instances.
+ opts-change - Changes the Java options of an existing container instance.
+ rename - Rename an existing container instance.
+ rmi-registry-port-change - Changes the RMI registry port (used by management layer) of an existing container instance.
+ rmi-server-port-change - Changes the RMI server port (used by management layer) of an existing instance.
+ ssh-port-change - Changes the secure shell port of an existing container instance.
+ start - Start an existing container instance.
+ status - Check the current status of an instance.
+ stop - Stop an existing container instance.
+Type 'command --help' for more help on the specified command.
+</pre><p>For instance, to list all the instances, you can use the <tt>instance</tt> script with the <tt>list</tt> command:</p><pre>
+bin/instance list
+SSH Port | RMI Registry | RMI Server | State | PID | Name
+-----------------------------------------------------------
+ 8101 | 1099 | 44444 | Stopped | 0 | root
+ 8102 | 1100 | 44445 | Stopped | 0 | test
+</pre><p>It's exactly the same as executing <tt>instance:list</tt> in the root instance.</p><p>You can obtain details about commands options and arguments using the <tt>--help</tt> option. For instance:</p><pre>
+bin/instance rename --help
+DESCRIPTION
+ instance:rename
+
+ Rename an existing container instance.
+
+SYNTAX
+ instance:rename [options] name new-name
+
+ARGUMENTS
+ name
+ The name of the container instance to rename
+ new-name
+ The new name of the container instance
+
+OPTIONS
+ --help
+ Display this help message
+ -v, --verbose
+ Display actions performed by the command (disabled by default)
+
+</pre><h2 id="JMXInstanceMBean">JMX InstanceMBean</h2><p>On the JMX layer, you have a MBean dedicated to the management of the instances: the InstanceMBean.</p><p>The ObjectName to use is <tt>org.apache.karaf:type=instance,name=*</tt>.</p><h3 id="Attributes">Attributes</h3><p>The <tt>Instances</tt> attribute is a tabular data attribute providing details about the instances:</p><ul><li><tt>Is Root</tt> (boolean): if true, the instance is the root instance, false else.</li><li><tt>JavaOpts</tt> (string): it contains the JVM arguments used by the instance.</li><li><tt>Location</tt> (string): it's the path to the instance storage.</li><li><tt>Name</tt> (string): it's the name of the instance.</li><li><tt>Pid</tt> (long): it's the current system process ID (PID) of the instance process.</li><li><tt>RMI Registry Port</tt> (int): it's the port number of the instance RMI Registry (JMX).</li><li><tt>RMI Server Port</tt> (int): it's the port number of the instance RMI Server (JMX).</li><li><t
t>SSH Port</tt> (int): it's the port number of the instance SSH Server.</li><li><tt>State</tt> (string): it's the current status of the instance (Stopped, Starting, Started).</li></ul><h3 id="Operations">Operations</h3><p>The InstanceMBean provides the following operations, corresponding to the previous <tt>instance:*</tt> commands:</p><ul><li><tt>createInstance(instanceName, sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts, features, featuresUrls)</tt>: create a new instance.</li><li><tt>changeSshPort(instanceName, port)</tt>: change the SSH port of an instance.</li><li><tt>changeRmiServerPort(instanceName, port)</tt>: change the RMI server port of an instance.</li><li><tt>changeRmiRegistry(instanceName, port)</tt>: change the RMI registry port of an instance.</li><li><tt>changeJavaOpts(instanceName, javaOpts)</tt>: change the Java options of an instance.</li><li><tt>destroyInstance(instanceName)</tt>: destroy an instance.</li><li><tt>startInstance(instanceName)</tt>: st
art an instance.</li><li><tt>startInstance(instanceName, options)</tt>: start an instance with the given Java options.</li><li><tt>startInstance(instanceName, options, wait, debug)</tt>: start an instance with the given Java options.<p> If wait is true, this operation is waiting for the instance is in "Started" state. If debug is true, the instance is started in debug mode.</p></li><li><tt>stopInstance(instanceName)</tt>: stop an instance.</li><li><tt>renameInstance(instanceName, newInstanceName)</tt>: rename an instance.</li><li><tt>renameInstance(instanceName, newInstanceName, verbose)</tt>: rename an instance. If verbose is true, this operation provides details in the log.</li><li><tt>cloneInstance(instanceName, cloneName, sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts)</tt>: clone an existing instance.</li></ul>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td id="cell-2-2" colspan="2">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-3-0">
+
+ </td>
+ <td id="cell-3-1">
+
+ </td>
+ <td id="cell-3-2">
+ <div id="footer">
+ <div id="site-footer">
+ © 2008-2011 The Apache Software Foundation
+ <br/>
+ Apache Karaf, Karaf, Apache, the Apache feather logo, and the Apache Karaf project logo are trademarks of The Apache Software Foundation.
+ </div>
+ </div>
+ </td>
+ <td id="cell-3-3">
+
+ </td>
+ <td id="cell-3-4">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-4-0" colspan="2">
+
+ </td>
+ <td id="cell-4-1">
+
+ </td>
+ <td id="cell-4-2" colspan="2">
+
+ </td>
+ </tr>
+ </table>
+ </body>
+</html>
\ No newline at end of file
Added: karaf/site/production/manual/latest-3.0.x/users-guide/jdbc.html
URL: http://svn.apache.org/viewvc/karaf/site/production/manual/latest-3.0.x/users-guide/jdbc.html?rev=1688692&view=auto
==============================================================================
--- karaf/site/production/manual/latest-3.0.x/users-guide/jdbc.html (added)
+++ karaf/site/production/manual/latest-3.0.x/users-guide/jdbc.html Wed Jul 1 17:06:42 2015
@@ -0,0 +1,246 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
+<html lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <meta name="description" content="description goes here"/>
+ <meta name="keywords" content="keywords,goes,here"/>
+ <meta name="author" content="The Apache Karaf Team"/>
+ <link href="../css/style.css" rel="stylesheet" type="text/css"/>
+ <link href="../css/pygmentize.css" rel="stylesheet" type="text/css"/>
+ <title>
+ Apache Karaf 3.0.5-SNAPSHOT Guides
+ </title>
+ </head>
+ <body>
+ <table width="100%" cellpadding="0" cellspacing="0">
+ <tr width="100%">
+ <td id="cell-0-0" colspan="2">
+
+ </td>
+ <td id="cell-0-1">
+
+ </td>
+ <td id="cell-0-2" colspan="2">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-1-0">
+
+ </td>
+ <td id="cell-1-1">
+
+ </td>
+ <td id="cell-1-2">
+ <div style="padding: 5px;">
+ <div id="banner">
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td align="left" class="topbardiv" nowrap="">
+<a href="http://karaf.apache.org/" title="A server side OSGi distribution">
+ <img border="0" src="../images/karaf-logo.png" width="400px"></img>
+</a>
+ </td>
+ <td align="right" nowrap="">
+<a href="http://www.apache.org/" title="The Apache Sofware Foundation">
+ <img border="0" src="../images/asf-logo.png">
+</a>
+ </td>
+ </tr>
+ </table>
+
+ </div>
+ <div id="top-menu">
+ <table border="0" cellpadding="1" cellspacing="0" width="100%">
+ <tr>
+ <td>
+ <div align="left"></div>
+ </td>
+ <td>
+ <div align="right">
+ <p>
+<a href="../index.html" title="Home">Home</a>
+|
+<a href="index.html" title="Users Guide">Users Guide</a>
+|
+<a href="../developers-guide/index.html" title="Developers Guide">Developers Guide</a>
+</p>
+
+
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </td>
+ <td id="cell-1-3">
+
+ </td>
+ <td id="cell-1-4">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-2-0" colspan="2">
+
+ </td>
+ <td id="cell-2-1">
+ <table>
+ <tr height="100%" valign="top">
+ <td height="100%">
+ <div id="wrapper-menu-page-right">
+ <div id="wrapper-menu-page-top">
+ <div id="wrapper-menu-page-bottom">
+ <div id="menu-page">
+ <h3 id="Homeindex"><a href="../index.html">Home</a></h3><ul style="list-style: square"><li><a href="../overview.html">Overview</a></li><li><a href="../quick-start.html">Quick Start</a></li></ul><h3 id="UsersGuideusersguideindex"><a href="index.html">Users Guide</a></h3><ul style="list-style: square"><li><a href="installation.html">Installation</a></li><li><a href="directory-structure.html">Directory structure</a></li><li><a href="start-stop.html">Start, stop, restart, connect</a></li><li><a href="wrapper.html">Integration in the operating system: the Service Wrapper</a></li><li><a href="console.html">Console</a></li><li><a href="remote.html">Remote</a></li><li><a href="log.html">Log</a></li><li><a href="configuration.html">Configuration</a></li><li><a href="urls.html">Artifacts repositories and URLs</a></li><li><a href="provisioning.html">Provisioning and features</a></li><li><a href="deployers.html">Deployers</a></li><li><a href="kar.html">KAR</a></li><li><a
href="instances.html">Instances</a></li><li><a href="security.html">Security</a></li><li><a href="obr.html">OBR</a></li><li><a href="enterprise.html">Enterprise</a><ul><li><a href="webcontainer.html">WebContainer (JSP/Servlet)</a></li><li><a href="jndi.html">Naming (JNDI)</a></li><li><a href="jta.html">Transaction (JTA)</a></li><li><a href="jdbc.html">DataSource (JDBC)</a></li><li><a href="jms.html">MOM (JMS)</a></li><li><a href="jpa.html">Persistence (JPA)</a></li><li><a href="ejb.html">EJB</a></li><li><a href="cdi.html">CDI</a></li><li><a href="failover.html">HA/failover and cluster</a></li></ul></li><li><a href="monitoring.html">Monitoring and Management using JMX</a></li><li><a href="webconsole.html">WebConsole</a></li><li><a href="tuning.html">Tuning</a></li></ul><h3 id="DevelopersGuidedevelopersguideindex"><a href="../developers-guide/index.html">Developers Guide</a></h3><ul style="list-style: square"><li><a href="../developers-guide/developer-commands.html">Developer command
s</a></li><li><a href="../developers-guide/scripting.html">Scripting</a></li><li><a href="../developers-guide/connect.html">Programmatically connect</a></li><li><a href="../developers-guide/branding.html">Branding</a></li><li><a href="../developers-guide/extending.html">Extending</a></li><li><a href="../developers-guide/karaf-maven-plugin.html">Karaf Maven plugin</a></li><li><a href="../developers-guide/custom-distribution.html">Custom distribution</a></li><li><a href="../developers-guide/services.html">OSGi services</a></li><li><a href="../developers-guide/creating-bundles.html">Create OSGi bundle</a></li><li><a href="../developers-guide/blueprint.html">Blueprint</a></li><li><a href="../developers-guide/cdi.html">CDI</a></li><li><a href="../developers-guide/archetypes.html">Maven Archetypes</a></li><li><a href="../developers-guide/security-framework.html">Security Framework</a></li><li><a href="../developers-guide/debugging.html">Troubleshooting, Debugging, Profiling</a></li><li><a
href="../developers-guide/writing-tests.html">Integration testing</a></li><li><a href="../developers-guide/github-contributions.html">Github Contributions</a></li></ul><h3 id="Commandscommandscommands"><a href="../commands/commands.html">Commands</a></h3>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ <td height="100%" width="100%">
+ <div class="wiki-content">
+<h1 id="DataSourcesJDBC">DataSources (JDBC)</h1><p>The Apache Karaf DataSources (JDBC) is an optional enterprise feature.</p><p>You have to install the <tt>jdbc</tt> feature first:</p><pre>
+karaf@root()> feature:install jdbc
+</pre><p>This feature provides an OSGi service to create/delete JDBC datasources in the container and perform database operations (SQL queries).</p><p>This JDBC OSGi service can be manipulated programmatically (see the developer guide for details), using the <tt>jdbc:*</tt> commands, or using the JDBC MBean.</p><h2 id="Commands">Commands</h2><h3 id="jdbccreate"><tt>jdbc:create</tt></h3><p>The <tt>jdbc:create</tt> command automatically creates a datasource definition file in the Apache Karaf <tt>deploy</tt> folder.</p><p>The <tt>jdbc:create</tt> accepts a set of options and the name argument:</p><pre>
+karaf@root()> jdbc:create --help
+DESCRIPTION
+ jdbc:create
+
+ Create a JDBC datasource
+
+SYNTAX
+ jdbc:create [options] name
+
+ARGUMENTS
+ name
+ The JDBC datasource name
+
+OPTIONS
+ -u, --username
+ The database username
+ -v, --version
+ The version of the driver to use
+ -t, --type
+ The JDBC datasource type (generic, MySQL, Oracle, Postgres, H2, HSQL, Derby, MSSQL)
+ -url
+ The JDBC URL to use
+ -p, --password
+ The database password
+ -i, --install-bundles
+ Try to install the bundles providing the JDBC driver
+ -d, --driver
+ The classname of the JDBC driver to use. NB: this option is used only the type generic
+ --help
+ Display this help message
+
+</pre><ul><li>the <tt>name</tt> argument is required. It's the name of the datasource. The name is used to identify the datasource, and to create the datasource definition file (<tt>deploy/datasource-<a href="name.html">name</a>.xml</tt>).</li><li>the <tt>-u</tt> option is optional. It defines the database username.</li><li>the <tt>-v</tt> option is optional. It "forces" a given JDBC driver version (only used with the <tt>-i</tt> option).</li><li>the <tt>-t</tt> option is required. It defines the JDBC datasource type. Accepted values are: MySQL, Oracle, Postgres, Derby, H2, HSQL, MSSQL, Generic. Generic is a generic configuration file using DBCP to create a pooled datasource. When using generic, it's up to you to install the JDBC driver and configure the <tt>deploy/datasource-<a href="name.html">name</a>.xml</tt> datasource file.</li><li>the <tt>-url</tt> option is optional. It defines the JDBC URL to access to the database.</li><li>the <tt>-p</tt> option is optional. It defines the
database password.</li><li>the <tt>-d</tt> option is optional. It defines the JDBC driver classname to use (only used with the generic type).</li><li>the <tt>-i</tt> option is optional. If specified, the command will try to automatically install the OSGi bundles providing the JDBC driver (depending of the datasource type specified by the <tt>-t</tt> option).</li></ul><p>For instance, to create an embedded Apache Derby database in Apache Karaf, you can do:</p><pre>
+karaf@root()> jdbc:create -t derby -u test -i test
+</pre><p>We can note that the Derby bundle has been installed automatically, and the datasource has been created:</p><pre>
+karaf@root()> la
+...
+87 | Active | 80 | 10.8.2000002.1181258 | Apache Derby 10.8
+88 | Active | 80 | 0.0.0 | datasource-test.xml
+</pre><p>We can see the <tt>deploy/datasource-test.xml</tt> datasource file.</p><h2 id="jdbcdelete"><tt>jdbc:delete</tt></h2><p>The <tt>jdbc:delete</tt> command deletes a datasource by removing the <tt>deploy/datasource-<a href="name.html">name</a>.xml</tt> datasource file:</p><pre>
+karaf@root()> jdbc:delete test
+</pre><div class="warning" style="border: 1px solid #c00;background-color: #fcc;margin: 20px;padding: 0px 6px 0px 6px;"><p>The <tt>jdbc:delete</tt> does not uninstall the JDBC driver bundles and does not remove the files created by the JDBC driver (or the database in case of embedded database).<br/>It's up to you to remove it.</p></div><h2 id="jdbcdatasources"><tt>jdbc:datasources</tt></h2><p>The <tt>jdbc:datasources</tt> command lists the JDBC datasources:</p><pre>
+karaf@root()> jdbc:datasources
+Name | Product | Version | URL
+------------------------------------------------------------------
+/jdbc/test | Apache Derby | 10.8.2.2 - (1181258) | jdbc:derby:test
+</pre><h2 id="jdbcinfo"><tt>jdbc:info</tt></h2><p>The <tt>jdbc:info</tt> command provides details about a JDBC datasource:</p><pre>
+karaf@root()> jdbc:info /jdbc/test
+Property | Value
+--------------------------------------------------
+driver.version | 10.8.2.2 - (1181258)
+username | APP
+db.version | 10.8.2.2 - (1181258)
+db.product | Apache Derby
+driver.name | Apache Derby Embedded JDBC Driver
+url | jdbc:derby:test
+</pre><h2 id="jdbcexecute"><tt>jdbc:execute</tt></h2><p>The <tt>jdbc:execute</tt> command executes a SQL query that doesn't return any result on a given JDBC datasource.</p><p>Typically, you can use the <tt>jdbc:execute</tt> command to create tables, insert values into tables, etc.</p><p>For instance, we can create a <tt>person</tt> table on our <tt>test</tt> datasource:</p><pre>
+karaf@root()> jdbc:execute /jdbc/test "create table person(name varchar(100), nick varchar(100))"
+</pre><p>And we can insert some records in the <tt>person</tt> table:</p><pre>
+karaf@root()> jdbc:execute /jdbc/test "insert into person(name, nick) values('foo','bar')"
+karaf@root()> jdbc:execute /jdbc/test "insert into person(name, nick) values('test','test')"
+</pre><h2 id="jdbcquery"><tt>jdbc:query</tt></h2><p>The <tt>jdbc:query</tt> command is similar to the <tt>jdbc:execute</tt> one but it displays the query result.</p><p>For instance, to display the content of the <tt>person</tt> table, we can do:</p><pre>
+karaf@root()> jdbc:query /jdbc/test "select * from person"
+NICK | NAME
+--------------------------------
+bar | foo
+test | test
+</pre><h2 id="jdbctables"><tt>jdbc:tables</tt></h2><p>The <tt>jdbc:tables</tt> command displays all tables available on a given JDBC datasource:</p><pre>
+karaf@root()> jdbc:tables /jdbc/test
+REF_GENERATION | TYPE_NAME | TABLE_NAME | TYPE_CAT | REMARKS | TYPE_SCHEM | TABLE_TYPE | TABLE_SCHEM | TABLE_CAT | SELF_REFERENCING_COL_NAME
+----------------------------------------------------------------------------------------------------------------------------------------------------
+ | | SYSALIASES | | | | SYSTEM TABLE | SYS | |
+ | | SYSCHECKS | | | | SYSTEM TABLE | SYS | |
+ | | SYSCOLPERMS | | | | SYSTEM TABLE | SYS | |
+ | | SYSCOLUMNS | | | | SYSTEM TABLE | SYS | |
+ | | SYSCONGLOMERATES | | | | SYSTEM TABLE | SYS | |
+ | | SYSCONSTRAINTS | | | | SYSTEM TABLE | SYS | |
+ | | SYSDEPENDS | | | | SYSTEM TABLE | SYS | |
+ | | SYSFILES | | | | SYSTEM TABLE | SYS | |
+ | | SYSFOREIGNKEYS | | | | SYSTEM TABLE | SYS | |
+ | | SYSKEYS | | | | SYSTEM TABLE | SYS | |
+ | | SYSPERMS | | | | SYSTEM TABLE | SYS | |
+ | | SYSROLES | | | | SYSTEM TABLE | SYS | |
+ | | SYSROUTINEPERMS | | | | SYSTEM TABLE | SYS | |
+ | | SYSSCHEMAS | | | | SYSTEM TABLE | SYS | |
+ | | SYSSEQUENCES | | | | SYSTEM TABLE | SYS | |
+ | | SYSSTATEMENTS | | | | SYSTEM TABLE | SYS | |
+ | | SYSSTATISTICS | | | | SYSTEM TABLE | SYS | |
+ | | SYSTABLEPERMS | | | | SYSTEM TABLE | SYS | |
+ | | SYSTABLES | | | | SYSTEM TABLE | SYS | |
+ | | SYSTRIGGERS | | | | SYSTEM TABLE | SYS | |
+ | | SYSVIEWS | | | | SYSTEM TABLE | SYS | |
+ | | SYSDUMMY1 | | | | SYSTEM TABLE | SYSIBM | |
+ | | PERSON | | | | TABLE | APP | |
+</pre><h2 id="JMXJDBCMBean">JMX JDBC MBean</h2><p>The JMX JDBC MBean provides the JDBC datasources, and the operations to manipulate datasources and database.</p><p>The object name to use is <tt>org.apache.karaf:type=jdbc,name=*</tt>.</p><h3 id="Attributes">Attributes</h3><p>The <tt>Datasources</tt> attribute provides a tabular data of all JDBC datasource, containing:</p><ul><li><tt>name</tt> is the JDBC datasource name</li><li><tt>product</tt> is the database product backend</li><li><tt>url</tt> is the JDBC URL used by the datasource</li><li><tt>version</tt> is the database version backend.</li></ul><h3 id="Operations">Operations</h3><ul><li><tt>create(name, type, jdbcDriverClassName, version, url, user, password, installBundles)</tt> creates a JDBC datasource (the arguments correspond to the options of the <tt>jdbc:create</tt> command).</li><li><tt>delete(name)</tt> deletes a JDBC datasource.</li><li><tt>info(datasource)</tt> returns a Map (String/String) of details about a JDBC <
tt>datasource</tt>.</li><li><tt>tables(datasource)</tt> returns a tabular data containing the tables available on a JDBC <tt>datasource</tt>.</li><li><tt>execute(datasource, command</tt> executes a SQL command on the given JDBC <tt>datasource</tt>.</li><li><tt>query(datasource, query</tt> executes a SQL query on the given JDBC <tt>datasource</tt> and return the execution result as tabular data.</li></ul>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td id="cell-2-2" colspan="2">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-3-0">
+
+ </td>
+ <td id="cell-3-1">
+
+ </td>
+ <td id="cell-3-2">
+ <div id="footer">
+ <div id="site-footer">
+ © 2008-2011 The Apache Software Foundation
+ <br/>
+ Apache Karaf, Karaf, Apache, the Apache feather logo, and the Apache Karaf project logo are trademarks of The Apache Software Foundation.
+ </div>
+ </div>
+ </td>
+ <td id="cell-3-3">
+
+ </td>
+ <td id="cell-3-4">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-4-0" colspan="2">
+
+ </td>
+ <td id="cell-4-1">
+
+ </td>
+ <td id="cell-4-2" colspan="2">
+
+ </td>
+ </tr>
+ </table>
+ </body>
+</html>
\ No newline at end of file
Added: karaf/site/production/manual/latest-3.0.x/users-guide/jms.html
URL: http://svn.apache.org/viewvc/karaf/site/production/manual/latest-3.0.x/users-guide/jms.html?rev=1688692&view=auto
==============================================================================
--- karaf/site/production/manual/latest-3.0.x/users-guide/jms.html (added)
+++ karaf/site/production/manual/latest-3.0.x/users-guide/jms.html Wed Jul 1 17:06:42 2015
@@ -0,0 +1,242 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
+<html lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <meta name="description" content="description goes here"/>
+ <meta name="keywords" content="keywords,goes,here"/>
+ <meta name="author" content="The Apache Karaf Team"/>
+ <link href="../css/style.css" rel="stylesheet" type="text/css"/>
+ <link href="../css/pygmentize.css" rel="stylesheet" type="text/css"/>
+ <title>
+ Apache Karaf 3.0.5-SNAPSHOT Guides
+ </title>
+ </head>
+ <body>
+ <table width="100%" cellpadding="0" cellspacing="0">
+ <tr width="100%">
+ <td id="cell-0-0" colspan="2">
+
+ </td>
+ <td id="cell-0-1">
+
+ </td>
+ <td id="cell-0-2" colspan="2">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-1-0">
+
+ </td>
+ <td id="cell-1-1">
+
+ </td>
+ <td id="cell-1-2">
+ <div style="padding: 5px;">
+ <div id="banner">
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td align="left" class="topbardiv" nowrap="">
+<a href="http://karaf.apache.org/" title="A server side OSGi distribution">
+ <img border="0" src="../images/karaf-logo.png" width="400px"></img>
+</a>
+ </td>
+ <td align="right" nowrap="">
+<a href="http://www.apache.org/" title="The Apache Sofware Foundation">
+ <img border="0" src="../images/asf-logo.png">
+</a>
+ </td>
+ </tr>
+ </table>
+
+ </div>
+ <div id="top-menu">
+ <table border="0" cellpadding="1" cellspacing="0" width="100%">
+ <tr>
+ <td>
+ <div align="left"></div>
+ </td>
+ <td>
+ <div align="right">
+ <p>
+<a href="../index.html" title="Home">Home</a>
+|
+<a href="index.html" title="Users Guide">Users Guide</a>
+|
+<a href="../developers-guide/index.html" title="Developers Guide">Developers Guide</a>
+</p>
+
+
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </td>
+ <td id="cell-1-3">
+
+ </td>
+ <td id="cell-1-4">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-2-0" colspan="2">
+
+ </td>
+ <td id="cell-2-1">
+ <table>
+ <tr height="100%" valign="top">
+ <td height="100%">
+ <div id="wrapper-menu-page-right">
+ <div id="wrapper-menu-page-top">
+ <div id="wrapper-menu-page-bottom">
+ <div id="menu-page">
+ <h3 id="Homeindex"><a href="../index.html">Home</a></h3><ul style="list-style: square"><li><a href="../overview.html">Overview</a></li><li><a href="../quick-start.html">Quick Start</a></li></ul><h3 id="UsersGuideusersguideindex"><a href="index.html">Users Guide</a></h3><ul style="list-style: square"><li><a href="installation.html">Installation</a></li><li><a href="directory-structure.html">Directory structure</a></li><li><a href="start-stop.html">Start, stop, restart, connect</a></li><li><a href="wrapper.html">Integration in the operating system: the Service Wrapper</a></li><li><a href="console.html">Console</a></li><li><a href="remote.html">Remote</a></li><li><a href="log.html">Log</a></li><li><a href="configuration.html">Configuration</a></li><li><a href="urls.html">Artifacts repositories and URLs</a></li><li><a href="provisioning.html">Provisioning and features</a></li><li><a href="deployers.html">Deployers</a></li><li><a href="kar.html">KAR</a></li><li><a
href="instances.html">Instances</a></li><li><a href="security.html">Security</a></li><li><a href="obr.html">OBR</a></li><li><a href="enterprise.html">Enterprise</a><ul><li><a href="webcontainer.html">WebContainer (JSP/Servlet)</a></li><li><a href="jndi.html">Naming (JNDI)</a></li><li><a href="jta.html">Transaction (JTA)</a></li><li><a href="jdbc.html">DataSource (JDBC)</a></li><li><a href="jms.html">MOM (JMS)</a></li><li><a href="jpa.html">Persistence (JPA)</a></li><li><a href="ejb.html">EJB</a></li><li><a href="cdi.html">CDI</a></li><li><a href="failover.html">HA/failover and cluster</a></li></ul></li><li><a href="monitoring.html">Monitoring and Management using JMX</a></li><li><a href="webconsole.html">WebConsole</a></li><li><a href="tuning.html">Tuning</a></li></ul><h3 id="DevelopersGuidedevelopersguideindex"><a href="../developers-guide/index.html">Developers Guide</a></h3><ul style="list-style: square"><li><a href="../developers-guide/developer-commands.html">Developer command
s</a></li><li><a href="../developers-guide/scripting.html">Scripting</a></li><li><a href="../developers-guide/connect.html">Programmatically connect</a></li><li><a href="../developers-guide/branding.html">Branding</a></li><li><a href="../developers-guide/extending.html">Extending</a></li><li><a href="../developers-guide/karaf-maven-plugin.html">Karaf Maven plugin</a></li><li><a href="../developers-guide/custom-distribution.html">Custom distribution</a></li><li><a href="../developers-guide/services.html">OSGi services</a></li><li><a href="../developers-guide/creating-bundles.html">Create OSGi bundle</a></li><li><a href="../developers-guide/blueprint.html">Blueprint</a></li><li><a href="../developers-guide/cdi.html">CDI</a></li><li><a href="../developers-guide/archetypes.html">Maven Archetypes</a></li><li><a href="../developers-guide/security-framework.html">Security Framework</a></li><li><a href="../developers-guide/debugging.html">Troubleshooting, Debugging, Profiling</a></li><li><a
href="../developers-guide/writing-tests.html">Integration testing</a></li><li><a href="../developers-guide/github-contributions.html">Github Contributions</a></li></ul><h3 id="Commandscommandscommands"><a href="../commands/commands.html">Commands</a></h3>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ <td height="100%" width="100%">
+ <div class="wiki-content">
+<h1 id="MOMJMS">MOM (JMS)</h1><p>The Apache Karaf MOM (Messaging Oriented Middleware/JMS) is an optional enterprise feature.</p><p>You have to install the <tt>jms</tt> feature first:</p><pre>
+karaf@root()> feature:install jms
+</pre><p>The <tt>jms</tt> feature doesn't install a JMS broker: it just installs the OSGi service, commands, and MBean to interact with<br/>a JMS broker (not the broker itself).</p><p>It means that you have to install a JMS broker itself.</p><p>This JMS broker can be available:</p><ul><li>outside of Apache Karaf, as a standalone broker. In that case, Apache Karaf JMS will remotely connect to the JMS broker.<p> For instance, you can use this topology with Apache ActiveMQ or IBM WebsphereMQ.</p></li><li>embedded in Apache Karaf. With this topology, Apache Karaf itself provides a JMS broker service. Apache ActiveMQ provides<p> a native support in Apache Karaf.</p><p>For instance, you can install Apache ActiveMQ directly in Apache Karaf:</p><pre>
+karaf@root()> feature:repo-add activemq
+Adding feature url mvn:org.apache.activemq/activemq-karaf/LATEST/xml/features
+karaf@root()> feature:install activemq-broker
+</pre></li></ul><p>The <tt>activemq-broker</tt> feature installs:</p><ul><li>a Apache ActiveMQ broker directly in Apache Karaf, bind to the <tt>61616</tt> port number by default.</li><li>the Apache ActiveMQ WebConsole bound to <tt>http://0.0.0.0:8181/activemqweb</tt> by default.</li></ul><p>The Apache Karaf <tt>jms</tt> feature provides an OSGi service to create/delete JMS connection factories in the container<br/>and perform JMS operations (send or consume messages, get information about a JMS broker, list the destinations, ...).</p><p>This JMS OSGi service can be manipulated programmatically (see the developer guide for details), using the <tt>jms:*</tt> commands, or using the JMS MBean.</p><h2 id="Commands">Commands</h2><h3 id="jmscreate"><tt>jms:create</tt></h3><p>The <tt>jms:create</tt> command creates a JMS connection factory in the Apache Karaf container. It automatically creates a<br/>blueprint XML file in the <tt>deploy</tt> folder containing the JMS connection factory defi
nition corresponding<br/>to the type that you mentioned.</p><p>The <tt>jms:create</tt> command accepts different arguments and options:</p><pre>
+karaf@root()> jms:create --help
+DESCRIPTION
+ jms:create
+
+ Create a JMS connection factory.
+
+SYNTAX
+ jms:create [options] name
+
+ARGUMENTS
+ name
+ The JMS connection factory name
+
+OPTIONS
+ -t, --type
+ The JMS connection factory type (ActiveMQ or WebsphereMQ)
+ (defaults to ActiveMQ)
+ -u, --username
+ Username to connect to the JMS broker
+ (defaults to karaf)
+ --help
+ Display this help message
+ --url
+ URL of the JMS broker. For WebsphereMQ type, the URL is hostname/port/queuemanager/channel
+ (defaults to tcp://localhost:61616)
+ -p, --password
+ Password to connect to the JMS broker
+ (defaults to karaf)
+
+</pre><ul><li>the <tt>name</tt> argument is required. It's the name of the JMS connection factory. The name is used to identify the connection factory, and to create the connection factory definition file (<tt>deploy/connectionfactory-<a href="name.html">name</a>.xml</tt>).</li><li>the <tt>-t</tt> (<tt>--type</tt>) option is required. It's the type of the JMS connection factory. Currently on <tt>activemq</tt> and <tt>webspheremq</tt> type are supported. If you want to use another type of JMS connection factory, you can create the <tt>deploy/connectionfactory-<a href="name.html">name</a>.xml</tt> file by hand (using one as template).</li><li>the <tt>--url</tt> option is required. It's the URL used by the JMS connection factory to connect to the broker. If the type is <tt>activemq</tt>, the URL looks like <tt>tcp://localhost:61616</tt>. If the type is <tt>webspheremq</tt>, the URL looks like <tt>host/port/queuemanager/channel</tt>.</li><li>the <tt>-u</tt> (<tt>--username</tt>) option
is optional (karaf by default). In the case of the broker requires authentication, it's the username used.</li><li>the <tt>-p</tt> (<tt>--password</tt>) option is optional (karaf by default). In the case of the broker requires authentication, it's the password used.</li></ul><p>For instance, to create a JMS connection factory for a Apache ActiveMQ broker, you can do:</p><pre>
+karaf@root()> jms:create -t activemq --url tcp://localhost:61616 test
+</pre><div class="warning" style="border: 1px solid #c00;background-color: #fcc;margin: 20px;padding: 0px 6px 0px 6px;"><p>The <tt>jms:create</tt> command doesn't install any feature or bundle providing the JMS connection factory classes (and dependencies).<br/>You have to install the required features (for instance <tt>activemq-broker</tt> feature for Apache ActiveMQ), or bundles (for IBM WebsphereMQ) providing the JMS connection factory packages and classes.</p></div><p>In the previous example, we assume that you previously installed the <tt>activemq-broker</tt> feature.</p><p>We can see the created JMS connection factory:</p><pre>
+karaf@root()> la
+...
+151 | Active | 80 | 0.0.0 | connectionfactory-test.xml
+</pre><p>The <tt>connectionfactory-test.xml</tt> file has been created in the <tt>deploy</tt> folder.</p><p>By default, the <tt>jms:create</tt> command constructs a JNDI name for the connection factory: <tt>/jms/<a href="name.html">name</a></tt>.</p><p>It means that the connection factory name to use for the other <tt>jms:*</tt> commands is <tt>/jms/<a href="name.html">name</a></tt>.</p><h3 id="jmsdelete"><tt>jms:delete</tt></h3><p>The <tt>jms:delete</tt> command deletes a JMS connection factory. The <tt>name</tt> argument is the name that you used at creation time:</p><pre>
+karaf@root()> jms:delete test
+</pre><h3 id="jmsconnectionfactories"><tt>jms:connectionfactories</tt></h3><p>The <tt>jms:connectionfactories</tt> command lists the JMS connection factories:</p><pre>
+karaf@root()> jms:connectionfactories
+JMS Connection Factory
+----------------------
+/jms/test
+</pre><h3 id="jmsinfo"><tt>jms:info</tt></h3><p>The <tt>jms:info</tt> command provides details about the JMS connection factory:</p><pre>
+karaf@root()> jms:info /jms/test
+Property | Value
+-------------------
+product | ActiveMQ
+version | 5.9.0
+</pre><p>You can see the JMS broker product and version.</p><p>If the JMS broker requires an authentication, you can use the <tt>-u</tt> (<tt>--username</tt>) and <tt>-p</tt> (<tt>--password</tt>) options.</p><h3 id="jmsqueues"><tt>jms:queues</tt></h3><p>The <tt>jms:queues</tt> command lists the JMS queues available on a JMS broker. For instance:</p><pre>
+karaf@root()> jms:queues /jms/test
+JMS Queues
+----------
+MyQueue
+</pre><p>where <tt>/jms/test</tt> is the name of the JMS connection factory.</p><p>If the JMS broker requires an authentication, you can use the <tt>-u</tt> (<tt>--username</tt>) and <tt>-p</tt> (<tt>--password</tt>) options.</p><div class="warning" style="border: 1px solid #c00;background-color: #fcc;margin: 20px;padding: 0px 6px 0px 6px;"><p>Depending of the JMS connection factory type, this command may not work.<br/>For now, the command works only with Apache ActiveMQ.</p></div><h3 id="jmstopics"><tt>jms:topics</tt></h3><p>The <tt>jms:topics</tt> command lists the JMS topics available on a JMS broker. For instance:</p><pre>
+karaf@root()> jms:topics /jms/test
+JMS Topics
+----------
+MyTopic
+</pre><p>where <tt>/jms/test</tt> is the name of the JMS connection factory.</p><p>If the JMS broker requires an authentication, you can use the <tt>-u</tt> (<tt>--username</tt>) and <tt>-p</tt> (<tt>--password</tt>) options.</p><div class="warning" style="border: 1px solid #c00;background-color: #fcc;margin: 20px;padding: 0px 6px 0px 6px;"><p>Depending of the JMS connection factory type, this command may not work.<br/>For now, the command works only with Apache ActiveMQ.</p></div><h3 id="jmssend"><tt>jms:send</tt></h3><p>The <tt>jms:send</tt> command sends a message to a given JMS queue.</p><p>For instance, to send a message containing <tt>Hello World</tt> in the <tt>MyQueue</tt> queue, you can do:</p><pre>
+karaf@root()> jms:send /jms/test MyQueue "Hello World"
+</pre><p>If the JMS broker requires an authentication, you can use the <tt>-u</tt> (<tt>--username</tt>) and <tt>-p</tt> (<tt>--password</tt>) options.</p><h3 id="jmsconsume"><tt>jms:consume</tt></h3><p>The <tt>jms:consume</tt> command consumes messages from a JMS queue.</p><p>For instance, to consume all messages from <tt>MyQueue</tt>, you can do:</p><pre>
+karaf@root()> jms:consume /jms/test MyQueue
+2 message(s) consumed
+</pre><p>If you want to consume only some messages, you can define a selector using the <tt>-s</tt> (<tt>--selector</tt>) option.</p><p>If the JMS broker requires an authentication, you can use the <tt>-u</tt> (<tt>--username</tt>) and <tt>-p</tt> (<tt>--password</tt>) options.</p><div class="warning" style="border: 1px solid #c00;background-color: #fcc;margin: 20px;padding: 0px 6px 0px 6px;"><p>The <tt>jms:consume</tt> command just consumes (so removes) messages from a JMS queue. It doesn't display the messages.<br/>If you want to see the details of messages, you can use the <tt>jms:browse</tt> command.</p></div><h3 id="jmscount"><tt>jms:count</tt></h3><p>The <tt>jms:count</tt> command counts the number of pending messages into a JMS queue.</p><p>For instance, if you want to know the number of messages on <tt>MyQueue</tt>, you can do:</p><pre>
+karaf@root()> jms:count /jms/test MyQueue
+Messages Count
+--------------
+8
+</pre><p>If the JMS broker requires an authentication, you can use the <tt>-u</tt> (<tt>--username</tt>) and <tt>-p</tt> (<tt>--password</tt>) options.</p><h3 id="jmsbrowse"><tt>jms:browse</tt></h3><p>The <tt>jms:browse</tt> command browses a JMS queue and display details about messages.</p><p>For instance, to browse the <tt>MyQueue</tt> queue:</p><pre>
+karaf@root()> jms:browse /jms/test MyQueue
+Message ID | Content | Charset | Type | Correlation ID | Delivery Mode | Destination | Expiration | Priority | Redelivered | ReplyTo | Timestamp
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ID:vostro-59602-1387462183019-3:1:1:1:1 | Hello World | UTF-8 | | | Persistent | queue://MyQueue | Never | 4 | false | | Thu Dec 19 15:10:12 CET 2013
+ID:vostro-59602-1387462183019-3:2:1:1:1 | Hello ActiveMQ | UTF-8 | | | Persistent | queue://MyQueue | Never | 4 | false | | Thu Dec 19 15:10:16 CET 2013
+ID:vostro-59602-1387462183019-3:3:1:1:1 | Hello Karaf | UTF-8 | | | Persistent | queue://MyQueue | Never | 4 | false | | Thu Dec 19 15:10:19 CET 2013
+</pre><p>By default, the messages properties are not displayed. You can use the <tt>-v</tt> (<tt>--verbose</tt>) option to display the properties:</p><pre>
+karaf@root()> jms:browse -v /jms/test MyQueue
+Message ID | Content | Charset | Type | Correlation ID | Delivery Mode | Destination | Expiration | Priority | Redelivered | ReplyTo | Timestamp | Properties
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ID:vostro-59602-1387462183019-3:1:1:1:1 | Hello World | UTF-8 | | | Persistent | queue://MyQueue | Never | 4 | false | | Thu Dec 19 15:10:12 CET 2013 |
+ID:vostro-59602-1387462183019-3:2:1:1:1 | Hello ActiveMQ | UTF-8 | | | Persistent | queue://MyQueue | Never | 4 | false | | Thu Dec 19 15:10:16 CET 2013 |
+ID:vostro-59602-1387462183019-3:3:1:1:1 | Hello Karaf | UTF-8 | | | Persistent | queue://MyQueue | Never | 4 | false | | Thu Dec 19 15:10:19 CET 2013 |
+</pre><p>If you want to browse only some messages, you can define a selector using the <tt>-s</tt> (<tt>--selector</tt>) option.</p><p>If the JMS broker requires an authentication, you can use the <tt>-u</tt> (<tt>--username</tt>) and <tt>-p</tt> (<tt>--password</tt>) options.</p><h3 id="jmsmove"><tt>jms:move</tt></h3><p>The <tt>jms:move</tt> command consumes all messages from a JMS queue and send it to another one.</p><p>For instance, to move all messages from <tt>MyQueue</tt> queue to <tt>AnotherQueue</tt> queue, you can do:</p><pre>
+karaf@root()> jms:move /jms/test MyQueue AnotherQueue
+3 message(s) moved
+</pre><h2 id="JMXJMSMBean">JMX JMS MBean</h2><p>The JMX JMS MBean provides the attributes and operations to manipulate the JMS connection factories and JMS messages.</p><p>The object name to use is <tt>org.apache.karaf:type=jms,name=*</tt>.</p><h3 id="Attributes">Attributes</h3><p>The <tt>Connectionfactories</tt> attribute provides the list of all JMS connection factories names.</p><h3 id="Operations">Operations</h3><ul><li><tt>create(name, type, url)</tt> creates a JMS connection factory.</li><li><tt>delete(name)</tt> deletes a JMS connection factory.</li><li><tt>Map<String, String> info(connectionFactory, username, password)</tt> gets details about a JMS connection factory and broker.</li><li><tt>int count(connectionFactory, queue, username, password)</tt> counts the number of pending messages on a JMS queue.</li><li><tt>List<String> queues(connectionFactory, username, password)</tt> lists the JMS queues available on the JMS broker.</li><li><tt>List<String> topics(connect
ionFactory, username, password)</tt> lists the JMS topics available on the JMS broker.</li><li><tt>TabularData browse(connectionFactory, queue, selector, username, password)</tt> browses a JMS queue and provides a table of JMS messages.</li><li><tt>send(connectionFactory, queue, content, replyTo, username, password)</tt> sends a JMS message to a target queue.</li><li><tt>int consume(connectionFactory, queue, selector, username, password)</tt> consumes JMS messages from a JMS queue.</li><li><tt>int move(connectionFactory, source, destination, selector, username, password)</tt> moves messages from a JMS queue to another.</li></ul>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td id="cell-2-2" colspan="2">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-3-0">
+
+ </td>
+ <td id="cell-3-1">
+
+ </td>
+ <td id="cell-3-2">
+ <div id="footer">
+ <div id="site-footer">
+ © 2008-2011 The Apache Software Foundation
+ <br/>
+ Apache Karaf, Karaf, Apache, the Apache feather logo, and the Apache Karaf project logo are trademarks of The Apache Software Foundation.
+ </div>
+ </div>
+ </td>
+ <td id="cell-3-3">
+
+ </td>
+ <td id="cell-3-4">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-4-0" colspan="2">
+
+ </td>
+ <td id="cell-4-1">
+
+ </td>
+ <td id="cell-4-2" colspan="2">
+
+ </td>
+ </tr>
+ </table>
+ </body>
+</html>
\ No newline at end of file
Added: karaf/site/production/manual/latest-3.0.x/users-guide/jndi.html
URL: http://svn.apache.org/viewvc/karaf/site/production/manual/latest-3.0.x/users-guide/jndi.html?rev=1688692&view=auto
==============================================================================
--- karaf/site/production/manual/latest-3.0.x/users-guide/jndi.html (added)
+++ karaf/site/production/manual/latest-3.0.x/users-guide/jndi.html Wed Jul 1 17:06:42 2015
@@ -0,0 +1,214 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
+<html lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <meta name="description" content="description goes here"/>
+ <meta name="keywords" content="keywords,goes,here"/>
+ <meta name="author" content="The Apache Karaf Team"/>
+ <link href="../css/style.css" rel="stylesheet" type="text/css"/>
+ <link href="../css/pygmentize.css" rel="stylesheet" type="text/css"/>
+ <title>
+ Apache Karaf 3.0.5-SNAPSHOT Guides
+ </title>
+ </head>
+ <body>
+ <table width="100%" cellpadding="0" cellspacing="0">
+ <tr width="100%">
+ <td id="cell-0-0" colspan="2">
+
+ </td>
+ <td id="cell-0-1">
+
+ </td>
+ <td id="cell-0-2" colspan="2">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-1-0">
+
+ </td>
+ <td id="cell-1-1">
+
+ </td>
+ <td id="cell-1-2">
+ <div style="padding: 5px;">
+ <div id="banner">
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td align="left" class="topbardiv" nowrap="">
+<a href="http://karaf.apache.org/" title="A server side OSGi distribution">
+ <img border="0" src="../images/karaf-logo.png" width="400px"></img>
+</a>
+ </td>
+ <td align="right" nowrap="">
+<a href="http://www.apache.org/" title="The Apache Sofware Foundation">
+ <img border="0" src="../images/asf-logo.png">
+</a>
+ </td>
+ </tr>
+ </table>
+
+ </div>
+ <div id="top-menu">
+ <table border="0" cellpadding="1" cellspacing="0" width="100%">
+ <tr>
+ <td>
+ <div align="left"></div>
+ </td>
+ <td>
+ <div align="right">
+ <p>
+<a href="../index.html" title="Home">Home</a>
+|
+<a href="index.html" title="Users Guide">Users Guide</a>
+|
+<a href="../developers-guide/index.html" title="Developers Guide">Developers Guide</a>
+</p>
+
+
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </td>
+ <td id="cell-1-3">
+
+ </td>
+ <td id="cell-1-4">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-2-0" colspan="2">
+
+ </td>
+ <td id="cell-2-1">
+ <table>
+ <tr height="100%" valign="top">
+ <td height="100%">
+ <div id="wrapper-menu-page-right">
+ <div id="wrapper-menu-page-top">
+ <div id="wrapper-menu-page-bottom">
+ <div id="menu-page">
+ <h3 id="Homeindex"><a href="../index.html">Home</a></h3><ul style="list-style: square"><li><a href="../overview.html">Overview</a></li><li><a href="../quick-start.html">Quick Start</a></li></ul><h3 id="UsersGuideusersguideindex"><a href="index.html">Users Guide</a></h3><ul style="list-style: square"><li><a href="installation.html">Installation</a></li><li><a href="directory-structure.html">Directory structure</a></li><li><a href="start-stop.html">Start, stop, restart, connect</a></li><li><a href="wrapper.html">Integration in the operating system: the Service Wrapper</a></li><li><a href="console.html">Console</a></li><li><a href="remote.html">Remote</a></li><li><a href="log.html">Log</a></li><li><a href="configuration.html">Configuration</a></li><li><a href="urls.html">Artifacts repositories and URLs</a></li><li><a href="provisioning.html">Provisioning and features</a></li><li><a href="deployers.html">Deployers</a></li><li><a href="kar.html">KAR</a></li><li><a
href="instances.html">Instances</a></li><li><a href="security.html">Security</a></li><li><a href="obr.html">OBR</a></li><li><a href="enterprise.html">Enterprise</a><ul><li><a href="webcontainer.html">WebContainer (JSP/Servlet)</a></li><li><a href="jndi.html">Naming (JNDI)</a></li><li><a href="jta.html">Transaction (JTA)</a></li><li><a href="jdbc.html">DataSource (JDBC)</a></li><li><a href="jms.html">MOM (JMS)</a></li><li><a href="jpa.html">Persistence (JPA)</a></li><li><a href="ejb.html">EJB</a></li><li><a href="cdi.html">CDI</a></li><li><a href="failover.html">HA/failover and cluster</a></li></ul></li><li><a href="monitoring.html">Monitoring and Management using JMX</a></li><li><a href="webconsole.html">WebConsole</a></li><li><a href="tuning.html">Tuning</a></li></ul><h3 id="DevelopersGuidedevelopersguideindex"><a href="../developers-guide/index.html">Developers Guide</a></h3><ul style="list-style: square"><li><a href="../developers-guide/developer-commands.html">Developer command
s</a></li><li><a href="../developers-guide/scripting.html">Scripting</a></li><li><a href="../developers-guide/connect.html">Programmatically connect</a></li><li><a href="../developers-guide/branding.html">Branding</a></li><li><a href="../developers-guide/extending.html">Extending</a></li><li><a href="../developers-guide/karaf-maven-plugin.html">Karaf Maven plugin</a></li><li><a href="../developers-guide/custom-distribution.html">Custom distribution</a></li><li><a href="../developers-guide/services.html">OSGi services</a></li><li><a href="../developers-guide/creating-bundles.html">Create OSGi bundle</a></li><li><a href="../developers-guide/blueprint.html">Blueprint</a></li><li><a href="../developers-guide/cdi.html">CDI</a></li><li><a href="../developers-guide/archetypes.html">Maven Archetypes</a></li><li><a href="../developers-guide/security-framework.html">Security Framework</a></li><li><a href="../developers-guide/debugging.html">Troubleshooting, Debugging, Profiling</a></li><li><a
href="../developers-guide/writing-tests.html">Integration testing</a></li><li><a href="../developers-guide/github-contributions.html">Github Contributions</a></li></ul><h3 id="Commandscommandscommands"><a href="../commands/commands.html">Commands</a></h3>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ <td height="100%" width="100%">
+ <div class="wiki-content">
+<h1 id="NamingJNDI">Naming (JNDI)</h1><p>The Apache Karaf Naming (JNDI) is an optional enterprise feature.</p><p>You have to install the <tt>jndi</tt> feature first:</p><pre>
+karaf@root()> feature:install jndi
+</pre><p>Apache Karaf provides a complete JNDI support.</p><p>You have two parts in the Apache Karaf JNDI support:</p><ul><li>a fully compliant implementation of the OSGi Alliance JNDI Service specification.</li><li>a more "regular" JNDI context, containing different names that you can administrate.</li></ul><h2 id="OSGiServicesRegistryandJNDI">OSGi Services Registry and JNDI</h2><p>The OSGi Service Registry provides a centralized register/query capabilities for OSGi services.</p><p>A common pattern outside of OSGi is to make use of JNDI API to access services from a directory system.<br/>The OSGi service registry can be viewed as an example of such a system.</p><p>Apache Karaf supports the <tt>osgi:service</tt> lookup scheme as defined by the JNDI Service Specification.</p><p>The schema is:</p><pre>
+osgi:service/<interface>[/<filter>]
+</pre><p>For instance, you can directly use JNDI to get a OSGi service:</p><pre>
+Context ctx = new InitialContext();
+Runnable r = (Runnable) ctx.lookup("osgi:service/java.lang.Runnable");
+</pre><h2 id="JNDIservice">JNDI service</h2><p>Apache Karaf also supports regular JNDI, including a directoy system where you can register name bindings, sub-context, etc.</p><p>It supports the standard JNDI API:</p><pre>
+Context ctx = new InitialContext();
+Runnable r = (Runnable) ctx.lookup("this/is/the/name");
+</pre><p>It also allows you to bind some OSGi services as "pure" JNDI name. In that case, you don't have to use the specific<br/><tt>osgi:service</tt> scheme.</p><h2 id="Commands">Commands</h2><p>Apache Karaf provides specific commands to manipulate the JNDI service.</p><h3 id="jndinames"><tt>jndi:names</tt></h3><p>The <tt>jndi:names</tt> command lists all JNDI names. It groups both the JNDI names from the <tt>osgi:service</tt> scheme and the<br/>regular JNDI names:</p><pre>
+karaf@root()> jndi:names
+JNDI Name | Class Name
+------------------------------------------------------------------
+osgi:service/jndi | org.apache.karaf.jndi.internal.JndiServiceImpl
+jndi/service | org.apache.karaf.jndi.internal.JndiServiceImpl
+</pre><p>We can see here the <tt>osgi:service/jndi</tt> name (using the <tt>osgi:service</tt> scheme) and <tt>jndi/service</tt> name (using the<br/>regular JNDI service).</p><p>The <tt>jndi:names</tt> command accepts an optional <tt>context</tt> argument to list names on the given context.</p><p>For instance, you can list only names in the <tt>jndi</tt> sub-context:</p><pre>
+karaf@root()> jndi:names jndi
+JNDI Name | Class Name
+----------------------------------------------------------
+service | org.apache.karaf.jndi.internal.JndiServiceImpl
+</pre><div class="warning" style="border: 1px solid #c00;background-color: #fcc;margin: 20px;padding: 0px 6px 0px 6px;"><p>The <tt>jndi:names</tt> lists only names (the full qualified name). It means that the empty JNDI sub-contexts are not displayed.<br/>To display all JNDI sub-contexts (empty or not), you can use the <tt>jndi:contexts</tt> command.</p></div><h3 id="jndicontexts"><tt>jndi:contexts</tt></h3><p>The <tt>jndi:contexts</tt> command lists all JNDI sub-contexts:</p><pre>
+karaf@root()> jndi:contexts
+JNDI Sub-Context
+----------------
+other/context
+foo/bar
+</pre><h3 id="jndicreate"><tt>jndi:create</tt></h3><p>The <tt>jndi:create</tt> command creates a new JNDI sub-context:</p><pre>
+karaf@root()> jndi:create my/company
+</pre><h3 id="jndidelete"><tt>jndi:delete</tt></h3><p>The <tt>jndi:delete</tt> command deletes a JNDI sub-context:</p><pre>
+karaf@root()> jndi:delete my/company
+</pre><h3 id="jndialias"><tt>jndi:alias</tt></h3><p>The <tt>jndi:alias</tt> command creates a new JNDI name (alias) with an existing one.</p><p>The existing JNDI name can be a regular one:</p><pre>
+karaf@root()> jndi:alias bean/services/jndi aliases/services/jndi
+karaf@root()> jndi:names
+JNDI Name | Class Name
+----------------------------------------------------------------------
+osgi:service/jndi | org.apache.karaf.jndi.internal.JndiServiceImpl
+bean/services/jndi | org.apache.karaf.jndi.internal.JndiServiceImpl
+aliases/services/jndi | org.apache.karaf.jndi.internal.JndiServiceImpl
+</pre><p>or a name from the <tt>osgi:service</tt> schema:</p><pre>
+karaf@root()> jndi:alias osgi:service/jndi alias/jndi/service
+karaf@root()> jndi:names
+JNDI Name | Class Name
+-------------------------------------------------------------------
+osgi:service/jndi | org.apache.karaf.jndi.internal.JndiServiceImpl
+alias/jndi/service | org.apache.karaf.jndi.internal.JndiServiceImpl
+</pre><p>NB: the <tt>jndi:alias</tt> automatically creates all required JNDI sub-contexts.</p><h3 id="jndibind"><tt>jndi:bind</tt></h3><p>The <tt>jndi:bind</tt> command binds an OSGi service with a JNDI name.</p><p>The <tt>jndi:bind</tt> command requires an OSGi service ID and a JNDI name. The OSGi service ID can be found using the <tt>service:list</tt> command.</p><p>For instance, we can bind the OSGi service with ID 344 with the JNDI name <tt>services/kar</tt>:</p><pre>
+karaf@root()> jndi:bind 344 services/kar
+karaf@root()> jndi:names
+JNDI Name | Class Name
+-------------------------------------------------------------------------------
+osgi:service/jndi | org.apache.karaf.jndi.internal.JndiServiceImpl
+services/kar | org.apache.karaf.kar.internal.KarServiceImpl
+</pre><h3 id="jndiunbind"><tt>jndi:unbind</tt></h3><p>The <tt>jndi:unbind</tt> command unbind a given JNDI name:</p><pre>
+karaf@root()> jndi:names
+JNDI Name | Class Name
+-------------------------------------------------------------------------------
+osgi:service/jndi | org.apache.karaf.jndi.internal.JndiServiceImpl
+services/kar | org.apache.karaf.kar.internal.KarServiceImpl
+karaf@root()> jndi:unbind services/kar
+karaf@root()> jndi:names
+JNDI Name | Class Name
+-------------------------------------------------------------------------------
+osgi:service/jndi | org.apache.karaf.jndi.internal.JndiServiceImpl
+</pre><div class="warning" style="border: 1px solid #c00;background-color: #fcc;margin: 20px;padding: 0px 6px 0px 6px;"><p>It's not possible to unbind a name from the <tt>osgi:service</tt> schema, as it's linked to a OSGi service.</p></div><h2 id="JMXJndiMBean">JMX JndiMBean</h2><p>The JMX JndiMBean provides the JNDI names, and the operations to manipulate the JNDI service.</p><p>The object name to use is <tt>org.apache.karaf:type=jndi,name=*</tt>.</p><h3 id="Attributes">Attributes</h3><p>The <tt>Names</tt> attribute provides a map containing all JNDI names and class names from both <tt>osgi:service</tt> scheme<br/>and the regular JNDI service.</p><p>The <tt>Contexts</tt> attribute provides a list containing all JNDI sub-contexts.</p><h3 id="Operations">Operations</h3><ul><li><tt>getNames(context)</tt> provides a map containing JNDI names and class names in a given JNDI sub-context.</li><li><tt>create(context)</tt> creates a new JNDI sub-context.</li><li><tt>delete(context)</tt> del
etes a JNDI sub-context.</li><li><tt>alias(name, alias</tt> creates a JNDI name (alias) for a given one.</li><li><tt>bind(serviceId, name</tt> binds a JNDI name using an OSGi service (identified by its ID).</li><li><tt>unbind(name)</tt> unbinds a JNDI name.</li></ul>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td id="cell-2-2" colspan="2">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-3-0">
+
+ </td>
+ <td id="cell-3-1">
+
+ </td>
+ <td id="cell-3-2">
+ <div id="footer">
+ <div id="site-footer">
+ © 2008-2011 The Apache Software Foundation
+ <br/>
+ Apache Karaf, Karaf, Apache, the Apache feather logo, and the Apache Karaf project logo are trademarks of The Apache Software Foundation.
+ </div>
+ </div>
+ </td>
+ <td id="cell-3-3">
+
+ </td>
+ <td id="cell-3-4">
+
+ </td>
+ </tr>
+ <tr width="100%">
+ <td id="cell-4-0" colspan="2">
+
+ </td>
+ <td id="cell-4-1">
+
+ </td>
+ <td id="cell-4-2" colspan="2">
+
+ </td>
+ </tr>
+ </table>
+ </body>
+</html>
\ No newline at end of file