com.enioka.jqm.model.Node.getName()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(11.0k)|赞(0)|评价(0)|浏览(302)

本文整理了Java中com.enioka.jqm.model.Node.getName()方法的一些代码示例,展示了Node.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getName()方法的具体详情如下:
包路径:com.enioka.jqm.model.Node
类名称:Node
方法名:getName

Node.getName介绍

[英]The functional key of the node. When starting an engine, it is given this name as its only parameter. It must be unique.
Max length is 100.
[中]节点的功能键。当启动引擎时,它的唯一参数就是这个名字。它必须是独一无二的。
最大长度为100。

代码示例

代码示例来源:origin: com.enioka.jqm/jqm-tst

  1. /**
  2. * This actually starts the different engines configured with {@link #addNode(String)}.<br>
  3. * This can usually only be called once (it can actually be called again but only after calling {@link #stop()}).
  4. */
  5. public JqmAsyncTester start()
  6. {
  7. if (hasStarted)
  8. {
  9. throw new IllegalStateException("cannot start twice");
  10. }
  11. if (nodes.isEmpty())
  12. {
  13. throw new IllegalStateException("no engines defined");
  14. }
  15. if (queues.isEmpty())
  16. {
  17. throw new IllegalStateException("no queues defined");
  18. }
  19. if (!oneQueueDeployed)
  20. {
  21. throw new IllegalStateException("no queue was ever deployed to any node");
  22. }
  23. hasStarted = true;
  24. for (Node n : nodes.values())
  25. {
  26. engines.put(n.getName(), JqmEngineFactory.startEngine(n.getName(), null));
  27. }
  28. return this;
  29. }

代码示例来源:origin: enioka/jqm

  1. /**
  2. * This actually starts the different engines configured with {@link #addNode(String)}.<br>
  3. * This can usually only be called once (it can actually be called again but only after calling {@link #stop()}).
  4. */
  5. public JqmAsyncTester start()
  6. {
  7. if (hasStarted)
  8. {
  9. throw new IllegalStateException("cannot start twice");
  10. }
  11. if (nodes.isEmpty())
  12. {
  13. throw new IllegalStateException("no engines defined");
  14. }
  15. if (queues.isEmpty())
  16. {
  17. throw new IllegalStateException("no queues defined");
  18. }
  19. if (!oneQueueDeployed)
  20. {
  21. throw new IllegalStateException("no queue was ever deployed to any node");
  22. }
  23. hasStarted = true;
  24. for (Node n : nodes.values())
  25. {
  26. engines.put(n.getName(), JqmEngineFactory.startEngine(n.getName(), null));
  27. }
  28. return this;
  29. }

代码示例来源:origin: com.enioka.jqm/jqm-engine

  1. private void registerMBean()
  2. {
  3. try
  4. {
  5. if (this.engine.loadJmxBeans)
  6. {
  7. MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
  8. name = new ObjectName(
  9. "com.enioka.jqm:type=Node.Queue,Node=" + this.engine.getNode().getName() + ",name=" + this.queue.getName());
  10. // Unregister MBean if it already exists. This may happen during frequent DP modifications.
  11. try
  12. {
  13. mbs.getMBeanInfo(name);
  14. mbs.unregisterMBean(name);
  15. }
  16. catch (InstanceNotFoundException e)
  17. {
  18. // Nothing to do, this should be the normal case.
  19. }
  20. mbs.registerMBean(this, name);
  21. }
  22. }
  23. catch (Exception e)
  24. {
  25. throw new JqmInitError("Could not create JMX beans", e);
  26. }
  27. }

代码示例来源:origin: enioka/jqm

  1. private void registerMBean()
  2. {
  3. try
  4. {
  5. if (this.engine.loadJmxBeans)
  6. {
  7. MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
  8. name = new ObjectName(
  9. "com.enioka.jqm:type=Node.Queue,Node=" + this.engine.getNode().getName() + ",name=" + this.queue.getName());
  10. // Unregister MBean if it already exists. This may happen during frequent DP modifications.
  11. try
  12. {
  13. mbs.getMBeanInfo(name);
  14. mbs.unregisterMBean(name);
  15. }
  16. catch (InstanceNotFoundException e)
  17. {
  18. // Nothing to do, this should be the normal case.
  19. }
  20. mbs.registerMBean(this, name);
  21. }
  22. }
  23. catch (Exception e)
  24. {
  25. throw new JqmInitError("Could not create JMX beans", e);
  26. }
  27. }

代码示例来源:origin: enioka/jqm

  1. jqmlogger.info("JQM engine " + this.node.getName() + " has received a stop order");
  2. jqmlogger.debug("Stop order was correctly handled. Engine for node " + this.node.getName() + " has stopped.");

代码示例来源:origin: com.enioka.jqm/jqm-engine

  1. jqmlogger.info("JQM engine " + this.node.getName() + " has received a stop order");
  2. jqmlogger.debug("Stop order was correctly handled. Engine for node " + this.node.getName() + " has stopped.");

代码示例来源:origin: enioka/jqm

  1. @Override
  2. public String getJmxBeanName()
  3. {
  4. return "com.enioka.jqm:type=Node.Queue.JobInstance,Node=" + this.engine.getNode().getName() + ",Queue="
  5. + this.qp.getQueue().getName() + ",name=" + this.ji.getId();
  6. }

代码示例来源:origin: com.enioka.jqm/jqm-engine

  1. @Override
  2. public String getJmxBeanName()
  3. {
  4. return "com.enioka.jqm:type=Node.Queue.JobInstance,Node=" + this.engine.getNode().getName() + ",Queue="
  5. + this.qp.getQueue().getName() + ",name=" + this.ji.getId();
  6. }

代码示例来源:origin: enioka/jqm

  1. void applyDeploymentParameter(DeploymentParameter dp)
  2. {
  3. this.pollingInterval = dp.getPollingInterval();
  4. this.maxNbThread = dp.getEnabled() ? dp.getNbThread() : 0;
  5. this.dpId = dp.getId();
  6. jqmlogger.info("Engine {}" + " will poll JobInstances on queue {} every {} s", engine.getNode().getName(), queue.getName(),
  7. pollingInterval / 1000);
  8. this.threadresourceManagerConfiguration.addParameter("com.enioka.jqm.rm.quantity.quantity", "" + this.maxNbThread);
  9. this.resourceManagers.get(0).refreshConfiguration(this.threadresourceManagerConfiguration);
  10. }

代码示例来源:origin: com.enioka.jqm/jqm-engine

  1. void applyDeploymentParameter(DeploymentParameter dp)
  2. {
  3. this.pollingInterval = dp.getPollingInterval();
  4. this.maxNbThread = dp.getEnabled() ? dp.getNbThread() : 0;
  5. this.dpId = dp.getId();
  6. jqmlogger.info("Engine {}" + " will poll JobInstances on queue {} every {} s", engine.getNode().getName(), queue.getName(),
  7. pollingInterval / 1000);
  8. this.threadresourceManagerConfiguration.addParameter("com.enioka.jqm.rm.quantity.quantity", "" + this.maxNbThread);
  9. this.resourceManagers.get(0).refreshConfiguration(this.threadresourceManagerConfiguration);
  10. }

代码示例来源:origin: enioka/jqm

  1. webAppContext.setInitParameter("jqmnode", node.getName());
  2. webAppContext.setInitParameter("jqmnodeid", node.getId().toString());

代码示例来源:origin: com.enioka.jqm/jqm-service

  1. webAppContext.setInitParameter("jqmnode", node.getName());
  2. webAppContext.setInitParameter("jqmnodeid", node.getId().toString());

代码示例来源:origin: com.enioka.jqm/jqm-runner-shell

  1. env.put("JQM_JI_DELIVERY_DIR", this.deliveryDir.getAbsolutePath());
  2. env.put("JQM_NODE_NAME", this.ji.getNode().getName());
  3. env.put("JQM_NODE_APPLICATION_ROOT", this.ji.getNode().getRepo());
  4. env.put("JQM_NODE_LOG_LEVEL", this.ji.getNode().getRootLogLevel());

代码示例来源:origin: enioka/jqm

  1. env.put("JQM_JI_DELIVERY_DIR", this.deliveryDir.getAbsolutePath());
  2. env.put("JQM_NODE_NAME", this.ji.getNode().getName());
  3. env.put("JQM_NODE_APPLICATION_ROOT", this.ji.getNode().getRepo());
  4. env.put("JQM_NODE_LOG_LEVEL", this.ji.getNode().getRootLogLevel());

代码示例来源:origin: enioka/jqm

  1. name = new ObjectName("com.enioka.jqm:type=Node,name=" + this.node.getName());
  2. mbs.registerMBean(this, name);
  3. JqmEngine.latestNodeStartedName = node.getName();
  4. if (this.handler != null)

代码示例来源:origin: com.enioka.jqm/jqm-engine

  1. .info("Poller loop on queue " + this.queue.getName() + " is stopping [engine " + this.engine.getNode().getName() + "]");
  2. waitForAllThreads(60L * 1000);

代码示例来源:origin: enioka/jqm

  1. @Test
  2. public void testTemplate() throws Exception
  3. {
  4. NodeDto template = MetaService.getNode(cnx, TestHelpers.nodeMix.getId());
  5. template.setPort(123);
  6. MetaService.upsertNode(cnx, template);
  7. cnx.commit();
  8. NodeDto target = MetaService.getNode(cnx, TestHelpers.node.getId());
  9. Assert.assertEquals(3, MetaService.getNodeQueueMappings(cnx, target.getId()).size());
  10. // Capital letter -> should be ignored.
  11. Main.runCommand(new String[] { "Install-NodeTemPlate", "-t", TestHelpers.nodeMix.getName(), "-n", TestHelpers.node.getName() });
  12. target = MetaService.getNode(cnx, TestHelpers.node.getId());
  13. Assert.assertEquals(template.getPort(), target.getPort());
  14. Assert.assertEquals(1, MetaService.getNodeQueueMappings(cnx, target.getId()).size());
  15. }
  16. }

代码示例来源:origin: enioka/jqm

  1. "com.enioka.jqm:type=Node.Queue.JobInstance,Node=" + TestHelpers.node.getName() + ",Queue=VIPQueue,name=" + i);
  2. System.out.println("Name to kill: " + killBean.toString());
  3. mbeans = mbsc.queryMBeans(killBean, null);
  4. ObjectName engine = new ObjectName("com.enioka.jqm:type=Node,name=" + TestHelpers.node.getName());
  5. JqmEngineMBean proxyEngine = JMX.newMBeanProxy(mbsc, engine, JqmEngineMBean.class);
  6. Assert.assertEquals(1, proxyEngine.getCumulativeJobInstancesCount() + proxyEngine.getCurrentlyRunningJobCount());
  7. ObjectName poller = new ObjectName("com.enioka.jqm:type=Node.Queue,Node=" + TestHelpers.node.getName() + ",name=VIPQueue");
  8. QueuePollerMBean proxyPoller = JMX.newMBeanProxy(mbsc, poller, QueuePollerMBean.class);
  9. Assert.assertEquals(1, proxyPoller.getCumulativeJobInstancesCount() + proxyPoller.getCurrentActiveThreadCount());

代码示例来源:origin: com.enioka.jqm/jqm-model

  1. /**
  2. * Create an History object from a {@link JobInstance}.
  3. *
  4. */
  5. public static void create(DbConn cnx, JobInstance ji, State finalState, Calendar endDate)
  6. {
  7. JobDef jd = ji.getJD();
  8. Node n = ji.getNode();
  9. Queue q = ji.getQ();
  10. if (endDate == null)
  11. {
  12. cnx.runUpdate("history_insert", ji.getId(), jd.getApplication(), jd.getApplicationName(), ji.getAttributionDate(),
  13. ji.getEmail(), ji.getCreationDate(), ji.getExecutionDate(), jd.isHighlander(), ji.getApplication(), ji.getKeyword1(),
  14. ji.getKeyword2(), ji.getKeyword3(), ji.getModule(), jd.getKeyword1(), jd.getKeyword2(), jd.getKeyword3(),
  15. jd.getModule(), n == null ? null : n.getName(), ji.getParentId(), ji.getProgress(), q == null ? null : q.getName(), 0,
  16. ji.getSessionID(), finalState.toString(), ji.getUserName(), ji.getJdId(), n == null ? null : n.getId(), ji.getQueue(),
  17. ji.isFromSchedule(), ji.getPriority());
  18. }
  19. else
  20. {
  21. cnx.runUpdate("history_insert_with_end_date", ji.getId(), jd.getApplication(), jd.getApplicationName(), ji.getAttributionDate(),
  22. ji.getEmail(), endDate, ji.getCreationDate(), ji.getExecutionDate(), jd.isHighlander(), ji.getApplication(),
  23. ji.getKeyword1(), ji.getKeyword2(), ji.getKeyword3(), ji.getModule(), jd.getKeyword1(), jd.getKeyword2(),
  24. jd.getKeyword3(), jd.getModule(), n.getName(), ji.getParentId(), ji.getProgress(), q.getName(), 0, ji.getSessionID(),
  25. finalState.toString(), ji.getUserName(), ji.getJdId(), ji.getNode().getId(), ji.getQueue(), ji.isFromSchedule(),
  26. ji.getPriority());
  27. }
  28. }

代码示例来源:origin: enioka/jqm

  1. /**
  2. * Create an History object from a {@link JobInstance}.
  3. *
  4. */
  5. public static void create(DbConn cnx, JobInstance ji, State finalState, Calendar endDate)
  6. {
  7. JobDef jd = ji.getJD();
  8. Node n = ji.getNode();
  9. Queue q = ji.getQ();
  10. if (endDate == null)
  11. {
  12. cnx.runUpdate("history_insert", ji.getId(), jd.getApplication(), jd.getApplicationName(), ji.getAttributionDate(),
  13. ji.getEmail(), ji.getCreationDate(), ji.getExecutionDate(), jd.isHighlander(), ji.getApplication(), ji.getKeyword1(),
  14. ji.getKeyword2(), ji.getKeyword3(), ji.getModule(), jd.getKeyword1(), jd.getKeyword2(), jd.getKeyword3(),
  15. jd.getModule(), n == null ? null : n.getName(), ji.getParentId(), ji.getProgress(), q == null ? null : q.getName(), 0,
  16. ji.getSessionID(), finalState.toString(), ji.getUserName(), ji.getJdId(), n == null ? null : n.getId(), ji.getQueue(),
  17. ji.isFromSchedule(), ji.getPriority());
  18. }
  19. else
  20. {
  21. cnx.runUpdate("history_insert_with_end_date", ji.getId(), jd.getApplication(), jd.getApplicationName(), ji.getAttributionDate(),
  22. ji.getEmail(), endDate, ji.getCreationDate(), ji.getExecutionDate(), jd.isHighlander(), ji.getApplication(),
  23. ji.getKeyword1(), ji.getKeyword2(), ji.getKeyword3(), ji.getModule(), jd.getKeyword1(), jd.getKeyword2(),
  24. jd.getKeyword3(), jd.getModule(), n.getName(), ji.getParentId(), ji.getProgress(), q.getName(), 0, ji.getSessionID(),
  25. finalState.toString(), ji.getUserName(), ji.getJdId(), ji.getNode().getId(), ji.getQueue(), ji.isFromSchedule(),
  26. ji.getPriority());
  27. }
  28. }

相关文章