@Override
  public void execute(FunctionContext context) {
    InternalLocator locator = InternalLocator.getLocator();
    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
    DistributedMember member = cache.getDistributedSystem().getDistributedMember();
    SharedConfigurationStatus status = locator.getSharedConfigurationStatus().getStatus();

    String memberId = member.getName();
    if (StringUtils.isBlank(memberId)) {
      memberId = member.getId();
    }

    CliFunctionResult result = new CliFunctionResult(memberId, new String[] {status.name()});
    context.getResultSender().lastResult(result);
  }
예제 #2
0
 /**
  * all Locator methods that start locators should use this method to start the locator and its
  * distributed system
  */
 private static Locator startLocator(
     int port,
     File logFile,
     InetAddress bindAddress,
     java.util.Properties dsProperties,
     boolean peerLocator,
     boolean serverLocator,
     String hostnameForClients)
     throws IOException {
   return InternalLocator.startLocator(
       port,
       logFile,
       null,
       (LogWriterI18n) null,
       (LogWriterI18n) null,
       bindAddress,
       dsProperties,
       peerLocator,
       serverLocator,
       hostnameForClients);
 }
예제 #3
0
 /**
  * Returns true if a locator exists in this JVM.
  *
  * @return true if a locator exists in this JVM.
  * @since 7.0
  */
 public static boolean hasLocator() {
   return InternalLocator.hasLocator();
 }
예제 #4
0
 /**
  * Returns the locator if it exists in this JVM. Otherwise returns null.
  *
  * @return the locator that exists in this JVM; null if no locator.
  * @since 7.0
  */
 public static Locator getLocator() {
   return InternalLocator.getLocator();
 }