Package org.apache.derby.iapi.services.monitor

Examples of org.apache.derby.iapi.services.monitor.PersistentService


            StorageFile logdir = logFactory.getLogDirectory();
           
            try
            {
                String name = Monitor.getMonitor().getServiceName(this);
                PersistentService ps =
                    Monitor.getMonitor().getServiceType(this);
                String fullName = ps.getCanonicalServiceName(name);
                Properties prop =
                    ps.getServiceProperties(fullName, (Properties)null);

                StorageFile defaultLogDir =
                    storageFactory.newStorageFile(
                        LogFactory.LOG_DIRECTORY_NAME);

                if (!logdir.equals(defaultLogDir)) 
                {
                    prop.remove(Attribute.LOG_DEVICE);
                    if (SanityManager.DEBUG)
                    {
                        SanityManager.ASSERT(
                            prop.getProperty(Attribute.LOG_DEVICE) == null,
                            "cannot get rid of logDevice property");
                    }

                    logHistory(historyFile,
                               MessageService.getTextMessage(
                               MessageId.STORE_EDITED_SERVICEPROPS));
                }
           
                // save the service properties into the backup.
                ps.saveServiceProperties(backupcopy.getPath(), prop, false);

            }
            catch(StandardException se)
            {
                logHistory(
View Full Code Here


                // service properties to indicate that database
                // is encrypted and also users can specify it as URL attribute
                // to encrypt and existing database.
                              
                String name = Monitor.getMonitor().getServiceName(this);
                PersistentService ps = Monitor.getMonitor().getServiceType(this);
                String canonicalName = ps.getCanonicalServiceName(name);
                Properties serviceprops = ps.getServiceProperties(canonicalName,
                                                                  (Properties)null);
                dataEncryption = serviceprops.getProperty(Attribute.DATA_ENCRYPTION);
                boolean encryptedDatabase = Boolean.valueOf(dataEncryption).booleanValue();

                if (!encryptedDatabase  && databaseEncrypted) {
View Full Code Here

        }
        else
        {
            try
            {
                PersistentService ps = Monitor.getMonitor().getServiceType(this);
                logStorageFactory = (WritableStorageFactory) ps.getStorageFactoryInstance( false, logDevice, null, null);
            }
            catch( IOException ioe)
            {
                if( SanityManager.DEBUG)
                    SanityManager.NOTREACHED();
View Full Code Here

        }
        else
        {
            try
            {
                PersistentService ps = Monitor.getMonitor().getServiceType(this);
                logStorageFactory = (WritableStorageFactory) ps.getStorageFactoryInstance( false, logDevice, null, null);
            }
            catch( IOException ioe)
            {
                if( SanityManager.DEBUG)
                    SanityManager.NOTREACHED();
View Full Code Here

    UUIDFactory uf = Monitor.getMonitor().getUUIDFactory();

    identifier = uf.createUUID();

        PersistentService ps = Monitor.getMonitor().getServiceType(this);

        try
        {
            storageFactory =
            ps.getStorageFactoryInstance( true,
                                          dataDirectory,
                                          startParams.getProperty(Property.STORAGE_TEMP_DIRECTORY,
                                                                  PropertyUtil.getSystemProperty(Property.STORAGE_TEMP_DIRECTORY)),
                                          identifier.toANSIidentifier());
        }
View Full Code Here

    Does this factory support this service type.
  */
  private boolean handleServiceType( Properties startParams, String type) {
        try
        {
            PersistentService ps = Monitor.getMonitor().getServiceProvider( startParams, type);
            return ps != null && ps.hasStorageFactory();
        }
        catch( StandardException se){ return false;}
  }
View Full Code Here

        // Read in property from service.properties file, remove
        // logDevice from it, then write it out again.
        try
        {
          String name = Monitor.getMonitor().getServiceName(this);
          PersistentService ps = Monitor.getMonitor().getServiceType(this);
          String fullName = ps.getCanonicalServiceName(name);
          Properties prop = ps.getServiceProperties(fullName, (Properties)null);

          prop.remove(Attribute.LOG_DEVICE);

          if (SanityManager.DEBUG)
            SanityManager.ASSERT(prop.getProperty(Attribute.LOG_DEVICE) == null,
                       "cannot get rid of logDevice property");

          ps.saveServiceProperties( backupcopy.getCanonicalPath(), prop, true);

          logHistory(historyFile,
                        MessageService.getTextMessage(
                            MessageId.STORE_EDITED_SERVICEPROPS));
View Full Code Here

    UUIDFactory uf = Monitor.getMonitor().getUUIDFactory();

    identifier = uf.createUUID();

        PersistentService ps = Monitor.getMonitor().getServiceType(this);

        try
        {
            storageFactory =
            ps.getStorageFactoryInstance(
                true,
                dataDirectory,
                startParams.getProperty(
                    Property.STORAGE_TEMP_DIRECTORY,
                    PropertyUtil.getSystemProperty(
View Full Code Here

  private boolean handleServiceType(
    String      type)
    {
        try
        {
            PersistentService ps =
                Monitor.getMonitor().getServiceProvider(type);
            return ps != null && ps.hasStorageFactory();
        }
        catch (StandardException se)
        {
            return false;
        }
View Full Code Here

    TopService ts = findTopService(serviceModule);

    if (ts == null)
      return null;

    PersistentService provider = ts.getServiceType();
    if (provider == null)
      return null;

    String serviceName = ts.getKey().getIdentifier();

    Properties properties = provider.getServiceProperties(serviceName, (Properties) null);

    properties = new UpdateServiceProperties(provider, serviceName, properties, true);

    return setLocale(properties, userDefinedLocale);
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.services.monitor.PersistentService

Copyright © 2018 www.massapicom. 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.