@Override protected Object invoke(String operationName, Object[] params, String[] signature) throws SchedulerException { try { return server.invoke(getSchedulerObjectName(), operationName, params, signature); } catch (Exception e) { throw new SchedulerException( "Failed to invoke Scheduler MBean operation: " + operationName, e); } } }
public void setJndiName(String jndiName) throws Exception { String oldName = this.jndiName; this.jndiName = jndiName; if (super.getState() == STARTED) { unbind(oldName); try { rebind(); } catch (NamingException ne) { log.error("Failed to rebind Scheduler", ne); throw new SchedulerConfigException( "Failed to rebind Scheduler - ", ne); } } }
/** * Initialize this remote MBean scheduler, getting the JBoss * RMIAdaptor for communication. */ @Override public void initialize() throws SchedulerException { InitialContext ctx = null; try { ctx = new InitialContext(getContextProperties()); server = (MBeanServerConnection)ctx.lookup(RMI_ADAPTOR_JNDI_NAME); } catch (Exception e) { throw new SchedulerException("Failed to lookup JBoss JMX RMI Adaptor.", e); } finally { if (ctx != null) { try { ctx.close(); } catch (NamingException ignore) { } } } }
@Override public void stopService() throws Exception { log.info("Stop QuartzService(" + jndiName + ")..."); try { Scheduler scheduler = schedulerFactory.getScheduler(); scheduler.shutdown(); } catch (Exception e) { log.error("Failed to shutdown Scheduler", e); throw new SchedulerConfigException( "Failed to shutdown Scheduler - ", e); } unbind(jndiName); log.info("QuartzService(" + jndiName + ") stopped."); }
@Override public void startService() throws Exception { log.info("Start QuartzService(" + jndiName + ")..."); try { rebind(); } catch (NamingException ne) { log.error("Failed to rebind Scheduler", ne); throw new SchedulerConfigException("Failed to rebind Scheduler - ", ne); } try { Scheduler scheduler = schedulerFactory.getScheduler(); if (startScheduler) { scheduler.start(); } else { log.info("Skipping starting the scheduler (will not run jobs)."); } } catch (Exception e) { log.error("Failed to start Scheduler", e); throw new SchedulerConfigException("Failed to start Scheduler - ", e); } log.info("QuartzService(" + jndiName + ") started."); }
public void setJndiName(String jndiName) throws Exception { String oldName = this.jndiName; this.jndiName = jndiName; if (super.getState() == STARTED) { unbind(oldName); try { rebind(); } catch (NamingException ne) { log.error("Failed to rebind Scheduler", ne); throw new SchedulerConfigException( "Failed to rebind Scheduler - ", ne); } } }
@Override protected Object invoke(String operationName, Object[] params, String[] signature) throws SchedulerException { try { return server.invoke(getSchedulerObjectName(), operationName, params, signature); } catch (Exception e) { throw new SchedulerException( "Failed to invoke Scheduler MBean operation: " + operationName, e); } } }
/** * Initialize this remote MBean scheduler, getting the JBoss * RMIAdaptor for communication. */ @Override public void initialize() throws SchedulerException { InitialContext ctx = null; try { ctx = new InitialContext(getContextProperties()); server = (MBeanServerConnection)ctx.lookup(RMI_ADAPTOR_JNDI_NAME); } catch (Exception e) { throw new SchedulerException("Failed to lookup JBoss JMX RMI Adaptor.", e); } finally { if (ctx != null) { try { ctx.close(); } catch (NamingException ignore) { } } } }
@Override public void stopService() throws Exception { log.info("Stop QuartzService(" + jndiName + ")..."); try { Scheduler scheduler = schedulerFactory.getScheduler(); scheduler.shutdown(); } catch (Exception e) { log.error("Failed to shutdown Scheduler", e); throw new SchedulerConfigException( "Failed to shutdown Scheduler - ", e); } unbind(jndiName); log.info("QuartzService(" + jndiName + ") stopped."); }
@Override public void startService() throws Exception { log.info("Start QuartzService(" + jndiName + ")..."); try { rebind(); } catch (NamingException ne) { log.error("Failed to rebind Scheduler", ne); throw new SchedulerConfigException("Failed to rebind Scheduler - ", ne); } try { Scheduler scheduler = schedulerFactory.getScheduler(); if (startScheduler) { scheduler.start(); } else { log.info("Skipping starting the scheduler (will not run jobs)."); } } catch (Exception e) { log.error("Failed to start Scheduler", e); throw new SchedulerConfigException("Failed to start Scheduler - ", e); } log.info("QuartzService(" + jndiName + ") started."); }
public void setJndiName(String jndiName) throws Exception { String oldName = this.jndiName; this.jndiName = jndiName; if (super.getState() == STARTED) { unbind(oldName); try { rebind(); } catch (NamingException ne) { log.error("Failed to rebind Scheduler", ne); throw new SchedulerConfigException( "Failed to rebind Scheduler - ", ne); } } }
@Override protected Object getAttribute(String attribute) throws SchedulerException { try { return server.getAttribute(getSchedulerObjectName(), attribute); } catch (Exception e) { throw new SchedulerException("Failed to get Scheduler MBean attribute: " + attribute, e); } }
/** * Initialize this remote MBean scheduler, getting the JBoss * RMIAdaptor for communication. */ @Override public void initialize() throws SchedulerException { InitialContext ctx = null; try { ctx = new InitialContext(getContextProperties()); server = (MBeanServerConnection)ctx.lookup(RMI_ADAPTOR_JNDI_NAME); } catch (Exception e) { throw new SchedulerException("Failed to lookup JBoss JMX RMI Adaptor.", e); } finally { if (ctx != null) { try { ctx.close(); } catch (NamingException ignore) { } } } }
@Override public void stopService() throws Exception { log.info("Stop QuartzService(" + jndiName + ")..."); try { Scheduler scheduler = schedulerFactory.getScheduler(); scheduler.shutdown(); } catch (Exception e) { log.error("Failed to shutdown Scheduler", e); throw new SchedulerConfigException( "Failed to shutdown Scheduler - ", e); } unbind(jndiName); log.info("QuartzService(" + jndiName + ") stopped."); }
@Override protected Object getAttribute(String attribute) throws SchedulerException { try { return server.getAttribute(getSchedulerObjectName(), attribute); } catch (Exception e) { throw new SchedulerException("Failed to get Scheduler MBean attribute: " + attribute, e); } }
@Override protected AttributeList getAttributes(String[] attributes) throws SchedulerException { try { return server.getAttributes(getSchedulerObjectName(), attributes); } catch (Exception e) { throw new SchedulerException("Failed to get Scheduler MBean attributes: " + Arrays.asList(attributes), e); } }
@Override protected AttributeList getAttributes(String[] attributes) throws SchedulerException { try { return server.getAttributes(getSchedulerObjectName(), attributes); } catch (Exception e) { throw new SchedulerException("Failed to get Scheduler MBean attributes: " + Arrays.asList(attributes), e); } }
@Override protected Object invoke(String operationName, Object[] params, String[] signature) throws SchedulerException { try { return server.invoke(getSchedulerObjectName(), operationName, params, signature); } catch (Exception e) { throw new SchedulerException( "Failed to invoke Scheduler MBean operation: " + operationName, e); } } }
@Override protected Object getAttribute(String attribute) throws SchedulerException { try { return server.getAttribute(getSchedulerObjectName(), attribute); } catch (Exception e) { throw new SchedulerException("Failed to get Scheduler MBean attribute: " + attribute, e); } }
@Override protected AttributeList getAttributes(String[] attributes) throws SchedulerException { try { return server.getAttributes(getSchedulerObjectName(), attributes); } catch (Exception e) { throw new SchedulerException("Failed to get Scheduler MBean attributes: " + Arrays.asList(attributes), e); } }