Package com.subhajit.processmanager.api

Examples of com.subhajit.processmanager.api.IHeartbeat


        public void run() {
          try {
            final IHeartbeatRepository repository = (IHeartbeatRepository) Class
                .forName(heartbeatRepositoryClassName)
                .getConstructor(String.class).newInstance(uid);
            final IHeartbeat heartbeat = new Heartbeat(System
                .currentTimeMillis(), uid, jmxUrl0);
            while (true) {
              repository.update(heartbeat);
              Thread.sleep(IHeartbeat.INTERVAL);
            }
View Full Code Here


      throws InterruptedException {
    final List<IHeartbeat> holder = new ArrayList<IHeartbeat>();
    Thread thread = new Thread(new Runnable() {
      public void run() {
        try {
          IHeartbeat ret = repo.getLatest(uid);
          if (ret == null) {
            try {
              Thread.sleep(millis);
            } catch (InterruptedException e) {
              Thread.currentThread().interrupt();
View Full Code Here

      MBeanException, ReflectionException, NullPointerException {
    if (status != ManagedProcessStatus.RUNNING) {
      throw new IllegalStateException("Cannot stop process in state - "
          + status.toString());
    }
    IHeartbeat heartbeat = getHeartbeat(millis);
    if (heartbeat == null) {
      return ManagedProcessStatus.UNKNOWN;
    }
    JMXServiceURL url = new JMXServiceURL(heartbeat.getManagementUrl());
    JMXConnector connector = null;
    try {
      connector = JMXConnectorFactory.connect(url);
      connector.getMBeanServerConnection().invoke(
          new ObjectName("launcher", "id", "bean"), "shutdown",
View Full Code Here

    }
  }

  private ManagedProcessStatus handleStoppingStatus()
      throws InterruptedException {
    IHeartbeat heartbeat = getHeartbeat(INTERVAL);
    if (heartbeat == null) {
      heartbeat = getHeartbeat(TWICE_THE_INTERVAL);
      if (heartbeat == null) {
        return ManagedProcessStatus.STOPPED;
      } else {
View Full Code Here

   * @return
   * @throws InterruptedException
   */
  private ManagedProcessStatus handleStartingStatus()
      throws InterruptedException {
    IHeartbeat heartbeat = getHeartbeat(INTERVAL);
    if (heartbeat == null) {
      heartbeat = getHeartbeat(TWICE_THE_INTERVAL);
      if (heartbeat == null) {
        return ManagedProcessStatus.START_FAILED;
      } else {
View Full Code Here

    return handleStartingStatus();
  }

  private ManagedProcessStatus handleRunningStatus()
      throws InterruptedException {
    IHeartbeat heartbeat = getHeartbeat(INTERVAL);
    if (heartbeat == null) {
      heartbeat = getHeartbeat(TWICE_THE_INTERVAL);
      if (heartbeat == null) {
        return ManagedProcessStatus.STOPPED;
      } else {
View Full Code Here

   */
  private ManagedProcessStatus handleUnknownStatus()
      throws InterruptedException {
    // Nothing to do.
    // return ManagedProcessStatus.UNKNOWN;
    IHeartbeat heartbeat = getHeartbeat(INTERVAL);
    if (heartbeat == null) {
      heartbeat = getHeartbeat(TWICE_THE_INTERVAL);
      if (heartbeat == null) {
        return ManagedProcessStatus.UNKNOWN;
      } else {
View Full Code Here

TOP

Related Classes of com.subhajit.processmanager.api.IHeartbeat

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.