Package org.tmatesoft.hg.internal

Examples of org.tmatesoft.hg.internal.DataSerializer$DataSource


            ServiceTarget serviceTarget = phaseContext.getServiceTarget();
            ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler();

            if (dataSources.getDataSource() != null && dataSources.getDataSource().size() > 0) {
                for (int i = 0; i < dataSources.getDataSource().size(); i++) {
                    DataSource ds = (DataSource)dataSources.getDataSource().get(i);
                    if (ds.isEnabled() && ds.getDriver() != null) {
                        try {
                            final String jndiName = Util.cleanJndiName(ds.getJndiName(), ds.isUseJavaContext());
                            LocalDataSourceService lds = new LocalDataSourceService(jndiName);
                            lds.getDataSourceConfigInjector().inject(buildDataSource(ds));
                            final String dsName = ds.getJndiName();
                            final PathAddress addr = getDataSourceAddress(dsName, deploymentUnit, false);
                            installManagementModel(ds, deploymentUnit, addr);
                            startDataSource(lds, jndiName, ds.getDriver(), serviceTarget, verificationHandler,
                                    getRegistration(false, deploymentUnit), getResource(dsName, false, deploymentUnit), dsName);
                        } catch (Exception e) {
                            throw ConnectorMessages.MESSAGES.exceptionDeployingDatasource(e, ds.getJndiName());
                        }
                    } else {
                        ConnectorLogger.DS_DEPLOYER_LOGGER.debugf("Ignoring: %s", ds.getJndiName());
                    }
                }
            }

            if (dataSources.getXaDataSource() != null && dataSources.getXaDataSource().size() > 0) {
View Full Code Here


        final List<DataSources> dataSourcesList = context.getAttachmentList(DsXmlDeploymentParsingProcessor.DATA_SOURCES_ATTACHMENT_KEY);

        for (final DataSources dataSources : dataSourcesList) {
            if (dataSources.getDataSource() != null) {
                for (int i = 0; i < dataSources.getDataSource().size(); i++) {
                    DataSource ds = (DataSource)dataSources.getDataSource().get(i);
                    undeployDataSource(ds, context);
                }
            }
            if (dataSources.getXaDataSource() != null) {
               for (int i = 0; i < dataSources.getXaDataSource().size(); i++) {
View Full Code Here

        }
   
        revlogHeader.length(content.length, compressedLen);
       
        // XXX may be wise not to create DataSerializer for each revision, but for a file
        DataSerializer sds = new DataSerializer() {
          @Override
            public void write(byte[] data, int offset, int length) throws HgIOException {
              try {
                indexFile.write(data, offset, length);
              } catch (IOException ex) {
                throw new HgIOException("Write failure", ex, currentFile);
              }
            }
        };
        revlogHeader.serialize(sds);

        if (useUncompressedData) {
          sds.writeByte((byte) 'u');
          dataSource.serialize(sds);
        } else {
          int actualCompressedLenWritten = revlogDataZip.writeCompressedData(sds);
          if (actualCompressedLenWritten != compressedLen) {
            throw new HgInvalidStateException(String.format("Expected %d bytes of compressed data, but actually wrote %d in %s", compressedLen, actualCompressedLenWritten, filename));
          }
        }
        sds.done();
        //
        revisionSequence.add(node);
        prevRevContent.done();
        prevRevContent = new ByteArrayDataAccess(content);
      } catch (HgIOException ex) {
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.internal.DataSerializer$DataSource

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.