コード例 #1
0
 public boolean isActive() {
   try {
     getInstance();
     return serviceInstance.isActive();
   } catch (ServiceImporterException e) {
     return false;
   }
 }
コード例 #2
0
  private T getInstance() throws ServiceImporterException {
    // DCL that works with Java 1.5 volatile semantics
    if (serviceInstance == null) {
      synchronized (this) {
        if (serviceInstance == null) {
          serviceInstance = (ImportedServiceInstance<T>) serviceModel.<T>importInstance(module);
          instance = serviceInstance.instance();
        }
      }
    }

    return instance;
  }