Examples of ContextManager


Examples of net.kuujo.vertigo.util.ContextManager

  private final Set<Handler<String>> joinHandlers = new HashSet<>();
  private final Set<Handler<String>> leaveHandlers = new HashSet<>();

  public HazelcastClusterListener(HazelcastInstance hazelcast, Vertx vertx) {
    this.nodeID = hazelcast.getCluster().getLocalMember().getUuid();
    this.context = new ContextManager(vertx);
    hazelcast.getCluster().addMembershipListener(this);
  }
View Full Code Here

Examples of net.kuujo.vertigo.util.ContextManager

    String groupName = container.config().getString("group", "DEFAULT");
    String nodeAddress = container.config().getString("node", Addresses.createUniqueAddress());
    PlatformManager platform = new DefaultPlatformManager(vertx, container);
    ClusterListener listener = new ClusterListenerFactory(vertx).createClusterListener(localOnly);
    ClusterData data = new ClusterDataFactory(vertx).createClusterData(localOnly);
    cluster = new DefaultClusterManager(clusterName, vertx, new ContextManager(vertx), platform, listener, data);
    group = new DefaultGroupManager(String.format("%s.%s", clusterName, groupName), clusterName, vertx, new ContextManager(vertx), platform, listener, data);
    node = new DefaultNodeManager(String.format("%s.%s.%s", clusterName, groupName, nodeAddress), String.format("%s.%s", clusterName, groupName), clusterName, vertx, new ContextManager(vertx), platform, listener, data);
    final CountingCompletionHandler<Void> counter = new CountingCompletionHandler<Void>(3);
    counter.setHandler(new Handler<AsyncResult<Void>>() {
      @Override
      public void handle(AsyncResult<Void> result) {
        if (result.failed()) {
View Full Code Here

Examples of net.kuujo.vertigo.util.ContextManager

  private final ContextManager context;
  private final Container container;
  private File modRoot;

  public DefaultPlatformManager(Vertx vertx, Container container) {
    this(vertx, container, new ContextManager(vertx));
  }
View Full Code Here

Examples of org.apache.avalon.fortress.util.ContextManager

        m_instrManager = new DefaultInstrumentManagerImpl();
        ContainerUtil.enableLogging(m_instrManager, new ConsoleLogger());
        ContainerUtil.initialize(m_instrManager);
        config.setInstrumentManager(m_instrManager);

        m_manager = new ContextManager( config.getContext(), new ConsoleLogger() );
        m_manager.initialize();
    }
View Full Code Here

Examples of org.apache.axis2.cluster.context.ContextManager

        ServiceContext serviceContext = new ServiceContext(axisService, serviceGroupContext);

        ClusterManager clusterManager =
                configurationContext.getAxisConfiguration().getClusterManager();
        if (clusterManager != null) {
          ContextManager contextManager = clusterManager.getContextManager();
          if (contextManager!=null) {
            contextManager.addContext(serviceGroupContext);
            contextManager.addContext(serviceContext);
          }
        }

        return serviceContext;
    }
View Full Code Here

Examples of org.apache.axis2.clustering.context.ContextManager

    public void execute(ConfigurationContext configCtx) throws ClusteringFault {
        ClusterManager clusterManager = configCtx.getAxisConfiguration().getClusterManager();
        if(clusterManager == null){
            return;
        }
        ContextManager contextManager = clusterManager.getContextManager();
        if (contextManager != null) {
            Map excludedPropPatterns = contextManager.getReplicationExcludePatterns();
            List cmdList = new ArrayList();

            // Add the service group contexts, service contexts & their respective properties
            String[] sgCtxIDs = configCtx.getServiceGroupContextIDs();
            for (int i  = 0; i < sgCtxIDs.length; i ++) {
View Full Code Here

Examples of org.apache.cocoon.webapps.session.ContextManager

            } else {
                authenticationFragment.appendChild(doc.importNode(data, true));
            }
           
            // now set this information in the temporary context
            ContextManager sessionManager = null;
            try {
                sessionManager = (ContextManager) this.manager.lookup( ContextManager.ROLE );
                SessionContext temp = sessionManager.getContext( SessionConstants.TEMPORARY_CONTEXT );
                temp.appendXML("/", authenticationFragment);
            } catch ( ServiceException se ) {
                throw new ProcessingException("Unable to lookup session manager.", se);
            } finally {
                this.manager.release( (Component)sessionManager );
View Full Code Here

Examples of org.apache.derby.iapi.services.context.ContextManager

     * We assume the System boot process has created a context
     * manager already, but not that contexts we need are there.
     */
    ContextService csf = ContextService.getFactory();

    ContextManager cm = csf.getCurrentContextManager();
    if (SanityManager.DEBUG)
      SanityManager.ASSERT((cm != null), "Failed to get current ContextManager");

    // RESOLVE other non-StandardException errors.
    bootingTC = null;
    try
    {
      // Get a transaction controller. This has the side effect of
      // creating a transaction context if there isn't one already.
      bootingTC = af.getTransaction(cm);

      /*
        We need an execution context so that we can generate rows
        REMIND: maybe only for create case?
       */
      exFactory.newExecutionContext(cm);

      DataDescriptorGenerator ddg = getDataDescriptorGenerator();

      //We should set the user schema collation type here now because
      //later on, we are going to create user schema APP. By the time any
      //user schema gets created, we should have the correct collation
      //type set for such schemas to use. For this reason, don't remove
      //the following if else statement and don't move it later in this
      //method.
      String userDefinedCollation;   
      if (create) {
        //Get the collation attribute from the JDBC url. It can only
        //have one of 2 possible values - UCS_BASIC or TERRITORY_BASED
        //This attribute can only be specified at database create time.
        //The attribute value has already been verified in DVF.boot and
        //hence we can be assured that the attribute value if provided
        //is either UCS_BASIC or TERRITORY_BASED. If none provided,
        //then we will take it to be the default which is UCS_BASIC.
        userDefinedCollation = startParams.getProperty(
            Attribute.COLLATION, Property.UCS_BASIC_COLLATION);   
        bootingTC.setProperty(Property.COLLATION,userDefinedCollation,true);
      } else {
        userDefinedCollation = startParams.getProperty(
            Property.COLLATION, Property.UCS_BASIC_COLLATION);
      }

      //Initialize the collation type of user schemas after looking at
      //collation property/attribute.
      if (userDefinedCollation.equalsIgnoreCase(Property.UCS_BASIC_COLLATION))
        collationTypeOfUserSchemas = StringDataValue.COLLATION_TYPE_UCS_BASIC;
      else
        collationTypeOfUserSchemas = StringDataValue.COLLATION_TYPE_TERRITORY_BASED;

      //Now is also a good time to create schema descriptor for global
      //temporary tables. Since this is a user schema, it should use the
      //collation type associated with user schemas. Since we just
      //finished setting up the collation type of user schema, it is
      //safe to create user SchemaDescriptor(s) now.
      declaredGlobalTemporaryTablesSchemaDesc =
              newDeclaredGlobalTemporaryTablesSchemaDesc(
                      SchemaDescriptor.STD_DECLARED_GLOBAL_TEMPORARY_TABLES_SCHEMA_NAME);
     
      if (create) {
        String userName = IdUtil.getUserNameFromURLProps(startParams);
        authorizationDatabaseOwner = IdUtil.getUserAuthorizationId(userName);
     
        // create any required tables.
        createDictionaryTables(startParams, bootingTC, ddg);
        //create procedures for network server metadata
        create_SYSIBM_procedures(bootingTC);
        //create metadata sps statement required for network server
        createSystemSps(bootingTC);
                // create the SYSCS_UTIL system procedures)
                create_SYSCS_procedures(bootingTC);
        // log the current dictionary version
        dictionaryVersion = softwareVersion;

        /* Set properties for current and create time
         * DataDictionary versions.
         */
        bootingTC.setProperty(
                    DataDictionary.CORE_DATA_DICTIONARY_VERSION,
                    dictionaryVersion, true);

        bootingTC.setProperty(
                    DataDictionary.CREATE_DATA_DICTIONARY_VERSION,
                    dictionaryVersion, true);

        // If SqlAuthorization is set as system property during database
        // creation, set it as database property also, so it gets persisted.
        if (PropertyUtil.getSystemBoolean(Property.SQL_AUTHORIZATION_PROPERTY))
        {
          bootingTC.setProperty(Property.SQL_AUTHORIZATION_PROPERTY,"true",true);
          usesSqlAuthorization=true;
        }
      } else {
        // Get the ids for non-core tables
        loadDictionaryTables(bootingTC, ddg, startParams);
        SchemaDescriptor sd = locateSchemaRow(SchemaDescriptor.IBM_SYSTEM_SCHEMA_NAME,
                 bootingTC);
        authorizationDatabaseOwner = sd.getAuthorizationId();
        String sqlAuth = PropertyUtil.getDatabaseProperty(bootingTC,
                    Property.SQL_AUTHORIZATION_PROPERTY);

        // Feature compatibility check.
        if (Boolean.valueOf
            (startParams.getProperty(
              Attribute.SOFT_UPGRADE_NO_FEATURE_CHECK))
            .booleanValue()) {
          // Do not perform check if this boot is the first
          // phase (soft upgrade boot) of a hard upgrade,
          // which happens in two phases beginning with
          // DERBY-2264. In this case, we need to always be
          // able to boot to authenticate, notwithstanding
          // any feature properties set
          // (e.g. derby.database.sqlAuthorization) which
          // may not yet be supported until that hard
          // upgrade has happened, normally causing an error
          // below.
          //
          // Feature sqlAuthorization is a special case:
          // Since database ownership checking only happens
          // when sqlAuthorization is true, we can't afford
          // to *not* use it for upgrades from 10.2 or
          // later, lest we lose the database owner check.
          // For upgrades from 10.1 and earlier there is no
          // database owner check at a hard upgrade.
          if (dictionaryVersion.majorVersionNumber >=
            DataDictionary.DD_VERSION_DERBY_10_2) {
            usesSqlAuthorization = Boolean.valueOf(sqlAuth).
              booleanValue();
          }
        } else {
          if (Boolean.valueOf(sqlAuth).booleanValue()) {
            // SQL authorization requires 10.2 or higher database
            checkVersion(DataDictionary.DD_VERSION_DERBY_10_2,
                   "sqlAuthorization");
            usesSqlAuthorization=true;
          }
        }
      }
         
      if (SanityManager.DEBUG)
        SanityManager.ASSERT((authorizationDatabaseOwner != null), "Failed to get Database Owner authorization");

      /* Commit & destroy the create database */
      bootingTC.commit();
      cm.getContext(ExecutionContext.CONTEXT_ID).popMe(); // done with ctx
    } finally {

      if (bootingTC != null) {
        bootingTC.destroy()// gets rid of the transaction context
        bootingTC = null;
View Full Code Here

Examples of org.apache.derby.iapi.services.context.ContextManager

    // client may have unsubscribed while it had items queued
    if (client == null)
      return;

    ContextManager cm = contextMgr;

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(cm != null, "Context manager is null");
      SanityManager.ASSERT(client != null, "client is null");
    }

    try
    {
      int status = client.performWork(cm);

      if (clientRecord.subscriber)
        return;

      if (status == Serviceable.REQUEUE)
      {
        List queue = client.serviceASAP() ? highPQ : normPQ;
        synchronized (this) {
          queue.add(clientRecord);

          if (SanityManager.DEBUG) {

            if (SanityManager.DEBUG_ON("memoryLeakTrace")) {

              if (queue.size() > (OPTIMAL_QUEUE_SIZE * 2))
                System.out.println("memoryLeakTrace:BasicDaemon " + queue.size());
            }
          }
        }
      }

      return;
    }
    catch (Throwable e)
    {
      if (SanityManager.DEBUG)
        SanityManager.showTrace(e);

            //Assume database is not active. DERBY-4856 thread dump
            cm.cleanupOnError(e, false);
    }
  }
View Full Code Here

Examples of org.apache.derby.iapi.services.context.ContextManager

     * @param global_id The global transaction we are searching for.
     **/
  public ContextManager findTransactionContextByGlobalId(
    GlobalXactId global_id)
  {
        ContextManager cm              = null;

        // Need to hold sync while linear searching the hash table.
        synchronized (trans)
        {
            for (Enumeration e = trans.elements(); e.hasMoreElements();)
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.