Examples of IHeartbeat


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

Examples of com.subhajit.processmanager.api.IHeartbeat

      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

Examples of com.subhajit.processmanager.api.IHeartbeat

      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

Examples of com.subhajit.processmanager.api.IHeartbeat

    }
  }

  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

Examples of com.subhajit.processmanager.api.IHeartbeat

   * @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

Examples of com.subhajit.processmanager.api.IHeartbeat

    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

Examples of com.subhajit.processmanager.api.IHeartbeat

   */
  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
Copyright © 2018 www.massapi.com. 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.