Package javax.management

Examples of javax.management.ObjectName$WeakObjectNameCache


      // Make sure all servers are created and started; make sure that database is zapped ONLY for
      // the first server, the others rely on values they expect to find in shared tables; don't
      // clear the database for those.

      ServiceAttributeOverrides override = new ServiceAttributeOverrides();
      override.put(new ObjectName("jboss.messaging.connectionfactory:service=ConnectionFactory"),
         "LoadBalancingFactory", "org.jboss.jms.client.plugin.RandomLoadBalancingFactory");
      ServerManagement.start(0, "all", override, true);

      try
      {
View Full Code Here


      // Make sure all servers are created and started; make sure that database is zapped ONLY for
      // the first server, the others rely on values they expect to find in shared tables; don't
      // clear the database for those.

      ServiceAttributeOverrides override = new ServiceAttributeOverrides();
      override.put(new ObjectName("jboss.messaging.connectionfactory:service=ConnectionFactory"),
         "LoadBalancingFactory", "org.jboss.jms.client.plugin.RandomLoadBalancingFactory");
      ServerManagement.start(0, "all", override, true);
      ServerManagement.start(1, "all", override, false);

      try
View Full Code Here

         "            <binding>/TestConnectionFactory</binding>\n" +
         "          </bindings>\n" +
         "       </attribute>\n" +
         " </mbean>";

      ObjectName on = ServerManagement.deploy(mbeanConfig);
      ServerManagement.invoke(on, "create", new Object[0], new String[0]);
      ServerManagement.invoke(on, "start", new Object[0], new String[0]);

      ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/TestConnectionFactory");
      Connection c = cf.createConnection();

      assertEquals("sofiavergara", c.getClientID());

      try
      {
         c.setClientID("somethingelse");
         fail("should throw exception");

      }
      catch(javax.jms.IllegalStateException e)
      {
         // OK
      }
     
      //Now try and deploy another one with the same client id
     
      mbeanConfig =
         "<mbean code=\"org.jboss.jms.server.connectionfactory.ConnectionFactory\"\n" +
         "       name=\"jboss.messaging.connectionfactory:service=TestConnectionFactory2\"\n" +
         "       xmbean-dd=\"xmdesc/ConnectionFactory-xmbean.xml\">\n" +
         "       <constructor>\n" +
         "           <arg type=\"java.lang.String\" value=\"sofiavergara\"/>\n" +
         "       </constructor>\n" +
         "       <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>\n" +
         "       <depends optional-attribute-name=\"Connector\">jboss.messaging:service=Connector,transport=bisocket</depends>\n" +
         "       <attribute name=\"JNDIBindings\">\n" +
         "          <bindings>\n" +
         "            <binding>/TestConnectionFactory2</binding>\n" +
         "          </bindings>\n" +
         "       </attribute>\n" +
         " </mbean>";
     
      ObjectName on2 = ServerManagement.deploy(mbeanConfig);
      ServerManagement.invoke(on2, "create", new Object[0], new String[0]);     
      ServerManagement.invoke(on2, "start", new Object[0], new String[0]);
     
     
      ServerManagement.invoke(on2, "stop", new Object[0], new String[0]);
View Full Code Here

     
      String name2 = "jboss.messaging:service=Connector2,transport=bisocket";
     
      String name3 = "jboss.messaging:service=Connector3,transport=bisocket";
     
      ObjectName c1 = deployConnector(1234, name1);
      ObjectName c2 = deployConnector(1235, name2);
      ObjectName c3 = deployConnector(1236, name3);
     
      ObjectName cf1 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory1", name1, "/TestConnectionFactory1", "clientid1");
      ObjectName cf2 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory2", name2, "/TestConnectionFactory2", "clientid2");
      ObjectName cf3 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory3", name3, "/TestConnectionFactory3", "clientid3");
      //Last one shares the same connector
      ObjectName cf4 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory4", name3, "/TestConnectionFactory4", "clientid4");
     
     
      JBossConnectionFactory f1 = (JBossConnectionFactory)initialContext.lookup("/TestConnectionFactory1");           
      ClientConnectionFactoryDelegate del1 = (ClientConnectionFactoryDelegate)f1.getDelegate();     
     
View Full Code Here

               "<handler subsystem=\"JMS\">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>\n" +
            "</handlers>\n" +
         "</config>\n" +
      "</attribute>\n";
     
      ObjectName on = ServerManagement.deploy(mbeanConfig);
     
      ServerManagement.setAttribute(on, "Configuration", config);
           
      ServerManagement.invoke(on, "create", new Object[0], new String[0]);
     
View Full Code Here

            "            <binding>" + binding + " </binding>\n" +
            "          </bindings>\n" +
            "       </attribute>\n" +
            " </mbean>";

      ObjectName on = ServerManagement.deploy(mbeanConfig);
      ServerManagement.invoke(on, "create", new Object[0], new String[0]);
      ServerManagement.invoke(on, "start", new Object[0], new String[0]);
     
      return on;
   }
View Full Code Here

         fail("this test should be run in a remote configuration");
      }

      // we need to disable exception listener otherwise it will clear up the connection itself
     
      ObjectName remoteConnectorName = ServiceContainer.REMOTING_OBJECT_NAME;
     
      ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
     
      localServer.getServerPeer().getServer().
         invoke(remoteConnectorName,
View Full Code Here

    protected void undeployWAR(final WARDeployable warDeployable) throws DeployerException {
        // get the root context of this deployable
        String contextRoot = warDeployable.getContextRoot();

        // Now, search the MBean of this context
        ObjectName contextObjectName = null;
        try {
            contextObjectName = new ObjectName(buildObjectName(warDeployable));
        } catch (MalformedObjectNameException e) {
            throw new DeployerException("Cannot get the ObjectName for the WAR deployable '" + warDeployable + "'.", e);
        } catch (NullPointerException e) {
            throw new DeployerException("Cannot get the ObjectName for the WAR deployable '" + warDeployable + "'.", e);
        }
View Full Code Here

     *         the MBean server.
     */
    @SuppressWarnings("unchecked")
    private ObjectName getEngineObjectName() throws DeployerException {
        // Build Engine object name
        ObjectName engineObjectName = null;
        try {
            engineObjectName = new ObjectName(ENGINE_OBJECT_NAME);
        } catch (MalformedObjectNameException e) {
            throw new DeployerException("Cannot build Tomcat Engine MBean.", e);
        } catch (NullPointerException e) {
            throw new DeployerException("Cannot build Tomcat Engine MBean.", e);
        }
View Full Code Here

    /**
     * @return the default host of the first engine found in the MBean server
     * @throws DeployerException if the MBean is not found.
     */
    private String getDefaultHost() throws DeployerException {
        ObjectName engineObjectName = getEngineObjectName();
        try {
            return MBeanServerHelper.getMBeanServerServer().getAttribute(engineObjectName, "defaultHost").toString();
        } catch (AttributeNotFoundException e) {
            throw new DeployerException("Cannot get the default host on the object name '" + engineObjectName + "'.", e);
        } catch (InstanceNotFoundException e) {
View Full Code Here

TOP

Related Classes of javax.management.ObjectName$WeakObjectNameCache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.