Examples of RegistryEntry


Examples of org.apache.synapse.registry.RegistryEntry

    }

    private Object getResource(Entry entry, Properties properties) {

        OMNode omNode;
        RegistryEntry re = registry.getRegistryEntry(entry.getKey());
        omNode = registry.lookup(entry.getKey());

        if (re == null) {
            return null;
        }

        if ((!entry.isCached() || (re.getVersion() == Long.MIN_VALUE ||
                re.getVersion() != entry.getVersion())) || re.getLastModified() >= lastExecutionTime) {
            entry.setEntryProperties(registry.getResourceProperties(entry.getKey()));
            entry.setVersion(re.getVersion());

            // if we get here, we have received the raw omNode from the
            // registry and our previous copy (if we had one) has expired or is not valid
            Object expiredValue = entry.getValue();

            // if we have a XMLToObjectMapper for this entry, use it to convert this
            // resource into the appropriate object - e.g. sequence or endpoint
            if (entry.getMapper() != null) {
                entry.setValue(entry.getMapper().getObjectFromOMNode(omNode, properties));

                if (entry.getValue() instanceof SequenceMediator) {
                    SequenceMediator seq = (SequenceMediator) entry.getValue();
                    seq.setDynamic(true);
                    seq.setRegistryKey(entry.getKey());
                    seq.init(synapseEnvironment);
                } else if (entry.getValue() instanceof  Endpoint) {
                    Endpoint ep = (Endpoint) entry.getValue();
                    ep.init(synapseEnvironment);
                }
            } else {
                // if the type of the object is known to have a mapper, create the
                // resultant Object using the known mapper, and cache this Object
                // else cache the raw OMNode
                entry.setValue(omNode);
            }

            if (expiredValue != null) {
                // Destroy the old resource so that everything is properly cleaned up
                if (expiredValue instanceof SequenceMediator) {
                    ((SequenceMediator) expiredValue).destroy();
                } else if (expiredValue instanceof Endpoint) {
                    ((Endpoint) expiredValue).destroy();
                }
            }

            entry.setVersion(re.getVersion());
        }

        // renew cache lease for another cachable duration (as returned by the
        // new getRegistryEntry() call
        if (re.getCachableDuration() > 0) {
            entry.setExpiryTime(
                    System.currentTimeMillis() + re.getCachableDuration());
        } else {
            entry.setExpiryTime(-1);
        }

        return entry.getValue();
View Full Code Here

Examples of org.apache.synapse.registry.RegistryEntry

                    "esb-resources/policy", "esb-resources/schema", "esb-resources/scripts",
                    "esb-resources/wsdl", "esb-resources/xslt"};
        }

        for (String collectionName : defaultCollections) {
            RegistryEntry collectionEntry = registry.getRegistryEntry(collectionName);
            if (collectionEntry != null
                    && ESBRegistryConstants.FOLDER.equals(collectionEntry.getType())) {
                if (log.isDebugEnabled()) {
                    log.debug("Collection named " + collectionName + " is there on " +
                            "the ESB registry, collection creation skipped");
                }
            } else {
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.registry.RegistryEntry

      setAttributeSmart(element, DEFAULT_INCREMENTAL_JOB_PERIOD, defIncrPeriod);
      setAttributeSmart(element, FULL_BACKUP_TYPE, fullBackupType);
      setAttributeSmart(element, INCREMENTAL_BACKUP_TYPE, incrementalBackupType);
      root.appendChild(element);

      RegistryEntry serviceEntry = new RegistryEntry(doc);
      registryService.createEntry(sessionProvider, RegistryService.EXO_SERVICES, serviceEntry);
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.registry.RegistryEntry

    */
   private void readParamsFromRegistryService(SessionProvider sessionProvider) throws PathNotFoundException,
      RepositoryException
   {
      String entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + BACKUP_PROPERTIES;
      RegistryEntry registryEntry = registryService.getEntry(sessionProvider, entryPath);
      Document doc = registryEntry.getDocument();
      Element element = doc.getDocumentElement();

      backupDir = getAttributeSmart(element, BACKUP_DIR);
      defIncrPeriod = getAttributeSmart(element, DEFAULT_INCREMENTAL_JOB_PERIOD);
      fullBackupType = getAttributeSmart(element, FULL_BACKUP_TYPE);
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.registry.RegistryEntry

      }

      observationListenerConfiguration = new ObservationListenerConfiguration();

      String entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + "nodeType";
      RegistryEntry registryEntry = registryService.getEntry(sessionProvider, entryPath);
      Document doc = registryEntry.getDocument();
      Element element = doc.getDocumentElement();
      nodeType = getAttributeSmart(element, "value");

      entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + "repository";
      registryEntry = registryService.getEntry(sessionProvider, entryPath);
      doc = registryEntry.getDocument();
      element = doc.getDocumentElement();
      observationListenerConfiguration.setRepository(getAttributeSmart(element, "value"));

      entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + "workspaces";
      registryEntry = registryService.getEntry(sessionProvider, entryPath);
      doc = registryEntry.getDocument();
      element = doc.getDocumentElement();
      String workspaces = getAttributeSmart(element, "value");

      String ws[] = workspaces.split(";");
      List<String> wsList = new ArrayList<String>();
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.registry.RegistryEntry

      element = doc.createElement("repository");
      setAttributeSmart(element, "value", observationListenerConfiguration.getRepository());
      root.appendChild(element);

      RegistryEntry serviceEntry = new RegistryEntry(doc);
      registryService.createEntry(sessionProvider, RegistryService.EXO_SERVICES, serviceEntry);
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.registry.RegistryEntry

      setAttributeSmart(element, DEFAULT_INCREMENTAL_JOB_PERIOD, defIncrPeriod);
      setAttributeSmart(element, FULL_BACKUP_TYPE, fullBackupType);
      setAttributeSmart(element, INCREMENTAL_BACKUP_TYPE, incrementalBackupType);
      root.appendChild(element);

      RegistryEntry serviceEntry = new RegistryEntry(doc);
      registryService.createEntry(sessionProvider, RegistryService.EXO_SERVICES, serviceEntry);
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.registry.RegistryEntry

    */
   private void readParamsFromRegistryService(SessionProvider sessionProvider) throws PathNotFoundException,
      RepositoryException
   {
      String entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + BACKUP_PROPERTIES;
      RegistryEntry registryEntry = registryService.getEntry(sessionProvider, entryPath);
      Document doc = registryEntry.getDocument();
      Element element = doc.getDocumentElement();

      backupDir = getAttributeSmart(element, BACKUP_DIR);
      defIncrPeriod = getAttributeSmart(element, DEFAULT_INCREMENTAL_JOB_PERIOD);
      fullBackupType = getAttributeSmart(element, FULL_BACKUP_TYPE);
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.registry.RegistryEntry

      element = doc.createElement("replication-priority-properties");
      setAttributeSmart(element, "priority-type", priprityType);
      setAttributeSmart(element, "node-priority", ownValue);
      root.appendChild(element);

      RegistryEntry serviceEntry = new RegistryEntry(doc);
      registryService.createEntry(sessionProvider, RegistryService.EXO_SERVICES, serviceEntry);
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.registry.RegistryEntry

    */
   private void readParamsFromRegistryService(SessionProvider sessionProvider) throws RepositoryException
   {
      // initialize repositories
      String entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + "repositories";
      RegistryEntry entry = registryService.getEntry(sessionProvider, entryPath);
      Document doc = entry.getDocument();
      Element element = doc.getDocumentElement();

      String repositories = getAttributeSmart(element, "repositories");
      repoNamesList = new ArrayList<String>();
      String reps[] = repositories.split(";");
      for (String rep : reps)
      {
         if (!rep.equals(""))
         {
            repoNamesList.add(rep);
         }
      }

      // initialize replication params;
      entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + "replication-properties";
      entry = registryService.getEntry(sessionProvider, entryPath);
      doc = entry.getDocument();
      element = doc.getDocumentElement();

      testMode = getAttributeSmart(element, "test-mode");
      enabled = getAttributeSmart(element, "enabled");
      mode = getAttributeSmart(element, "mode");
      bindIPAddress = getAttributeSmart(element, "bind-ip-address");
      channelConfig = getAttributeSmart(element, "channel-config");
      channelName = getAttributeSmart(element, "channel-name");
      recDir = getAttributeSmart(element, "recovery-dir");
      ownName = getAttributeSmart(element, "node-name");
      participantsCluster = getAttributeSmart(element, "other-participants");
      sWaitConfirmation = getAttributeSmart(element, "wait-confirmation");

      // initialize snapshot params;
      entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + "replication-snapshot-properties";
      entry = registryService.getEntry(sessionProvider, entryPath);
      doc = entry.getDocument();
      element = doc.getDocumentElement();

      sBackupEnabled = getAttributeSmart(element, "snapshot-enabled");
      sBackupDir = getAttributeSmart(element, "snapshot-dir");
      sDelayTime = getAttributeSmart(element, "delay-time");

      // initialize priority params;
      entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + "replication-priority-properties";
      entry = registryService.getEntry(sessionProvider, entryPath);
      doc = entry.getDocument();
      element = doc.getDocumentElement();

      priprityType = getAttributeSmart(element, "priority-type");
      ownValue = getAttributeSmart(element, "node-priority");

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.