Package org.xmlBlaster.util.context

Examples of org.xmlBlaster.util.context.ContextNode


         return;
      String[] keys = (String[])jmxMap.keySet().toArray(new String[jmxMap.size()]);
      for (int i=0; i < keys.length; i++) {
         Object obj = jmxMap.get(keys[i]);
         String name = keys[i];
         ContextNode child = new ContextNode(ContextNode.CONTRIB_MARKER_TAG, name, this.contextNode);
         log.info("MBean '" + name + "' found. Will attach it as '" + child.getRelativeName() + "' to '" + this.contextNode.getAbsoluteName() + "'");
         try {
            JmxMBeanHandle mBeanHandle = this.global.registerMBean(child, obj);
            this.jmxHandleSet.add(mBeanHandle);
         }
         catch(XmlBlasterException e) {
View Full Code Here


         this.mbeanHandle = null;
         if (handle != null)
            this.glob.unregisterMBean(handle);
        
         if (this.glob instanceof ServerScope) {
            ContextNode parent = ((ServerScope)this.glob).getRunlevelManager().getContextNode();
            this.contextNode = new ContextNode(ContextNode.RUNLEVEL_PLUGIN_MARKER_TAG,
                  this.id, parent);
            try {
               this.mbeanHandle = this.glob.registerMBean(this.contextNode, this);
            }
            catch(XmlBlasterException e) {
View Full Code Here

   /**
    * @see #getPlugin(String, String, StorageId, QueuePropertyBase)
    */
   public I_Queue getPlugin(String typeVersion, StorageId storageId, QueuePropertyBase props) throws XmlBlasterException {
      return getPlugin(new PluginInfo(glob, this, typeVersion,
              new ContextNode(this.pluginEnvClass, storageId.getRelatingType(), glob.getContextNode())),
              storageId, props);
   }
View Full Code Here

    * @param fn The file name for persistence or null (will be generated or ignored if RAM based)
    * @return The plugin for this type and version or null if none is specified or type=="undef"
    */
   public I_Queue getPlugin(String type, String version, StorageId storageId, QueuePropertyBase props) throws XmlBlasterException {
      return getPlugin(new PluginInfo(glob, this, type, version,
              new ContextNode(this.pluginEnvClass, storageId.getRelatingType(), glob.getContextNode())),
              storageId, props);
   }
View Full Code Here

      if (log.isLoggable(Level.FINEST)) {
         log.finest(ME+": plugin paramenters: '" + this.pluginConfig.dumpPluginParameters() + "'");
         log.finest(ME+": plugin user data  : '" + this.pluginConfig.getUserData() + "'");
      }
      // For JMX instanceName may not contain ","
      this.contextNode = new ContextNode(ContextNode.SERVICE_MARKER_TAG,
            "FilePollerPlugin[" + getType() + "]", global.getScopeContextNode());
      this.mbeanHandle = global.registerMBean(this.contextNode, this);
   }
View Full Code Here

      this.glob = glob;

      this.ME = "RunlevelManager" + this.glob.getLogPrefixDashed();
      if (log.isLoggable(Level.FINER)) log.finer("Incarnated run level manager");
      // For JMX instanceName may not contain ","
      this.contextNode = new ContextNode(ContextNode.SERVICE_MARKER_TAG,
            "RunlevelManager", this.glob.getScopeContextNode());
     
      this.allowDynamicPlugins = this.glob.getProperty().get("xmlBlaster/allowDynamicPlugins", false);
      if (allowDynamicPlugins) {
         String text = "xmlBlaster/allowDynamicPlugins=true: Please protect this feature as any code can be injected, add preventive authorization settings, see http://www.xmlBlaster.org/xmlBlaster/doc/requirements/engine.runlevel.howto.html#dynamic";
View Full Code Here

      initSubscriptionId(); // initialize the unique id this.uniqueKey
      ME += "-" + this.uniqueKey ;

      // For JMX instanceName may not contain ","
      String instanceName = this.glob.validateJmxValue(this.uniqueKey);
      this.contextNode = new ContextNode(ContextNode.SUBSCRIPTION_MARKER_TAG, instanceName,
                           this.glob.getContextNode());
      this.mbeanHandle = this.glob.registerMBean(this.contextNode, this);

      if (log.isLoggable(Level.FINE)) log.fine("Created SubscriptionInfo '" + getSubscriptionId() + "' for client '" + sessionInfo.getSessionName().getRelativeName() + "' for topic '" + this.keyData.getOid() + "'");
   }
View Full Code Here

  
   protected void doInit(Global glob, PluginInfo plugInfo) throws XmlBlasterException {
      SchedulerFactory schedFact = new org.quartz.impl.StdSchedulerFactory();
      try {
         String instanceName = getType();
         ContextNode contextNode = new ContextNode(ContextNode.SERVICE_MARKER_TAG, instanceName,
               this.global.getContextNode());
         if (!this.global.isRegisteredMBean(contextNode))
            this.mbeanHandle = this.global.registerMBean(contextNode, this);
        
         sched = schedFact.getScheduler();
View Full Code Here

   }

   public void testMerge() {
      System.out.println("***ContextNodeTest: testMerge ...");
      {
         ContextNode root = ContextNode.valueOf("/node/heron/client/joe");
         ContextNode other = ContextNode.valueOf("/node/xyz/client/joe/session/1");
         ContextNode leaf = root.mergeChildTree(other);
         System.out.println("Orig=" + root.getAbsoluteName() + " merge=" + other.getAbsoluteName() + " result=" + leaf.getAbsoluteName());
         assertEquals("merge", "/xmlBlaster/node/heron/client/joe/session/1", leaf.getAbsoluteName());
      }
      {
         ContextNode root = ContextNode.valueOf("/node/heron/client/joe/session/1");
         ContextNode other = ContextNode.valueOf("/node/xyz/client/joe/session/1");
         ContextNode leaf = root.mergeChildTree(other);
         System.out.println("Orig=" + root.getAbsoluteName() + " merge=" + other.getAbsoluteName() + " result=" + leaf.getAbsoluteName());
         assertEquals("merge", "/xmlBlaster/node/heron/client/joe/session/1", leaf.getAbsoluteName());
      }
      {
         ContextNode root = ContextNode.valueOf("/node/heron/client/joe/session/1");
         ContextNode other = ContextNode.valueOf("/node/xyz/service/Pop3Driver");
         ContextNode leaf = root.mergeChildTree(other);
         System.out.println("Orig=" + root.getAbsoluteName() + " merge=" + other.getAbsoluteName() + " result=" + leaf.getAbsoluteName());
         assertEquals("merge", "/xmlBlaster/node/heron/client/joe/session/1/service/Pop3Driver", leaf.getAbsoluteName());
      }
   }
View Full Code Here

      try {
         String[] urls = { "/xmlBlaster/node/heron", "/node/heron" };
         for (int i=0; i<urls.length; i++) {
            String url = urls[i];
            System.out.println("Testing syntax parsing: " + url);
            ContextNode contextNode = ContextNode.valueOf(url);
            assertEquals("", "heron", contextNode.getInstanceName());
            assertEquals("", ContextNode.CLUSTER_MARKER_TAG, contextNode.getClassName());
            assertTrue("parent not null", contextNode.getParent() == null);
            assertEquals("", "/xmlBlaster/node/heron", contextNode.getAbsoluteName());
            assertEquals("", "node/heron", contextNode.getRelativeName());
         }
      }
      catch (IllegalArgumentException e) {
         fail("testParse failed: " + e.toString());
      }

      try {
         String[] urls = { "/xmlBlaster/node/heron/client/joe/session/1", "/node/heron" };
         for (int i=0; i<urls.length; i++) {
            String url = urls[i];
            System.out.println("Testing syntax parsing: " + url);
            ContextNode contextNode = ContextNode.valueOf(url);
            ContextNode cluster = contextNode.getParent(ContextNode.CLUSTER_MARKER_TAG);
            assertEquals("", "heron", cluster.getInstanceName());
         }
      }
      catch (IllegalArgumentException e) {
         fail("testParse failed: " + e.toString());
      }
        
      try {
         String[] urls = { "org.xmlBlaster:nodeClass=node,node=heron",
                           "org.xmlBlaster:nodeClass=node,node=heron,connectionClass=connection,connection=jack,queueClass=queue,queue=connection-99" };
         for (int i=0; i<urls.length; i++) {
            String url = urls[i];
            System.out.println("Testing JMX syntax parsing: " + url);
            ContextNode contextNode = ContextNode.valueOf(url);
            ContextNode cluster = contextNode.getParent(ContextNode.CLUSTER_MARKER_TAG);
            assertEquals("", "heron", cluster.getInstanceName());
         }
      }
      catch (IllegalArgumentException e) {
         fail("testParse failed: " + e.toString());
      }

      try {
         String url = "org.xmlBlaster:nodeClass=node,node=\"avalon\",connectionClass=connection,connection=\"jack\",queueClass=queue,queue=\"connection-99\"";
         ContextNode newParentNode = ContextNode.valueOf("org.xmlBlaster:nodeClass=node,node=heron");
         System.out.println("Testing JMX syntax parsing: " + url);
         ContextNode contextNode = ContextNode.valueOf(url);
         contextNode.changeParentName(newParentNode);
         String newString = contextNode.getAbsoluteName(ContextNode.SCHEMA_JMX);
         assertEquals("", "org.xmlBlaster:nodeClass=node,node=\"heron\",connectionClass=connection,connection=\"jack\",queueClass=queue,queue=\"connection-99\"",
                          newString);
      }
      catch (IllegalArgumentException e) {
         fail("testParse failed: " + e.toString());
      }

      try {
         ContextNode contextNode = ContextNode.valueOf(null);
         assertTrue("Expected null", contextNode==ContextNode.ROOT_NODE);
      }
      catch (IllegalArgumentException e) {
         fail(e.toString());
      }
        
      try {
         ContextNode contextNode = ContextNode.valueOf("");
         assertTrue("Expected null", contextNode==ContextNode.ROOT_NODE);
      }
      catch (IllegalArgumentException e) {
         fail(e.toString());
      }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.context.ContextNode

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.