當前位置: 首頁>>代碼示例>>Java>>正文


Java TransporterFactory類代碼示例

本文整理匯總了Java中org.eclipse.aether.spi.connector.transport.TransporterFactory的典型用法代碼示例。如果您正苦於以下問題:Java TransporterFactory類的具體用法?Java TransporterFactory怎麽用?Java TransporterFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TransporterFactory類屬於org.eclipse.aether.spi.connector.transport包,在下文中一共展示了TransporterFactory類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: create

import org.eclipse.aether.spi.connector.transport.TransporterFactory; //導入依賴的package包/類
public RepositorySystem create() throws Throwable{

        DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
        locator.addService( RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class );
        locator.addService( TransporterFactory.class, FileTransporterFactory.class );
        locator.addService( TransporterFactory.class, HttpTransporterFactory.class );

        final List<Throwable> ecs=new ArrayList<Throwable>();
        locator.setErrorHandler( new DefaultServiceLocator.ErrorHandler()
        {
            @Override
            public void serviceCreationFailed( Class<?> type, Class<?> impl, Throwable exception )
            {
                ecs.add(exception);
            }
        } );
        RepositorySystem repositorySystem=locator.getService( RepositorySystem.class );
        if (!ecs.isEmpty()){
        	throw ecs.get(0);
        }

        return repositorySystem;
    }
 
開發者ID:microsofia,項目名稱:microsofia-boot,代碼行數:24,代碼來源:RepositorySystemBuilder.java

示例2: newRepositorySystem

import org.eclipse.aether.spi.connector.transport.TransporterFactory; //導入依賴的package包/類
private RepositorySystem newRepositorySystem() {
	/*
	 * Aether's components implement org.eclipse.aether.spi.locator.Service
	 * to ease manual wiring and using the prepopulated
	 * DefaultServiceLocator, we only need to register the repository
	 * connector and transporter factories.
	 */
	final DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
	locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
	locator.addService(TransporterFactory.class, FileTransporterFactory.class);

	locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
		@Override
		public void serviceCreationFailed(final Class<?> type, final Class<?> impl, final Throwable exception) {
			exception.printStackTrace();
		}
	});

	return locator.getService(RepositorySystem.class);
}
 
開發者ID:SourcePond,項目名稱:release-maven-plugin-parent,代碼行數:21,代碼來源:NestedModulesBaseTest.java

示例3: configure

import org.eclipse.aether.spi.connector.transport.TransporterFactory; //導入依賴的package包/類
@Override
protected void configure() {
	bind(ModelLocator.class).to(DefaultModelLocator.class).in(Singleton.class);
	bind(ModelReader.class).to(DefaultModelReader.class).in(Singleton.class);
	bind(ModelValidator.class).to(DefaultModelValidator.class).in(Singleton.class);
	bind(RepositoryConnectorFactory.class).to(BasicRepositoryConnectorFactory.class)
			.in(Singleton.class);
	bind(ArtifactDescriptorReader.class) //
			.to(DefaultArtifactDescriptorReader.class).in(Singleton.class);
	bind(VersionResolver.class) //
			.to(DefaultVersionResolver.class).in(Singleton.class);
	bind(VersionRangeResolver.class) //
			.to(DefaultVersionRangeResolver.class).in(Singleton.class);
	bind(MetadataGeneratorFactory.class).annotatedWith(Names.named("snapshot")) //
			.to(SnapshotMetadataGeneratorFactory.class).in(Singleton.class);
	bind(MetadataGeneratorFactory.class).annotatedWith(Names.named("versions")) //
			.to(VersionsMetadataGeneratorFactory.class).in(Singleton.class);
	bind(TransporterFactory.class).annotatedWith(Names.named("http"))
			.to(HttpTransporterFactory.class).in(Singleton.class);
	bind(TransporterFactory.class).annotatedWith(Names.named("file"))
			.to(FileTransporterFactory.class).in(Singleton.class);
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-function,代碼行數:23,代碼來源:DependencyResolver.java

示例4: newRepositorySystem

import org.eclipse.aether.spi.connector.transport.TransporterFactory; //導入依賴的package包/類
public static RepositorySystem newRepositorySystem ()
{
    final DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator ();

    locator.addService ( RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class );
    locator.addService ( TransporterFactory.class, FileTransporterFactory.class );
    locator.addService ( TransporterFactory.class, HttpTransporterFactory.class );

    locator.setErrorHandler ( new ErrorHandler () {
        @Override
        public void serviceCreationFailed ( final Class<?> type, final Class<?> impl, final Throwable exception )
        {
            final Logger logger = LoggerFactory.getLogger ( impl );
            logger.warn ( "Service creation failed: " + type.getName (), exception );
        }
    } );

    return locator.getService ( RepositorySystem.class );
}
 
開發者ID:eclipse,項目名稱:packagedrone,代碼行數:20,代碼來源:Helper.java

示例5: newRepositorySystem

import org.eclipse.aether.spi.connector.transport.TransporterFactory; //導入依賴的package包/類
public static RepositorySystem newRepositorySystem ()
{
    final DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator ();
    locator.addService ( RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class );
    locator.addService ( TransporterFactory.class, FileTransporterFactory.class );
    locator.addService ( TransporterFactory.class, HttpTransporterFactory.class );

    locator.setErrorHandler ( new DefaultServiceLocator.ErrorHandler () {
        @Override
        public void serviceCreationFailed ( final Class<?> type, final Class<?> impl, final Throwable exception )
        {
            exception.printStackTrace ();
        }
    } );

    return locator.getService ( RepositorySystem.class );
}
 
開發者ID:eclipse,項目名稱:packagedrone,代碼行數:18,代碼來源:MavenUtil.java

示例6: newRepositorySystem

import org.eclipse.aether.spi.connector.transport.TransporterFactory; //導入依賴的package包/類
private static RepositorySystem newRepositorySystem()
{
    DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
    locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
    locator.addService(TransporterFactory.class, FileTransporterFactory.class);
    locator.addService(TransporterFactory.class, HttpTransporterFactory.class);

    //locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
    //    @Override
    //    public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception)
    //    {
    //        exception.printStackTrace();
    //    }
    //});

    return locator.getService(RepositorySystem.class);
}
 
開發者ID:treasure-data,項目名稱:digdag,代碼行數:18,代碼來源:RemotePluginLoader.java

示例7: newRepositorySystem

import org.eclipse.aether.spi.connector.transport.TransporterFactory; //導入依賴的package包/類
public RepositorySystem newRepositorySystem() {
       /*
        * Aether's components implement org.eclipse.aether.spi.locator.Service to ease manual wiring and using the
        * prepopulated DefaultServiceLocator, we only need to register the repository connector and transporter
        * factories.
        */
	DefaultServiceLocator defaultLocator = MavenRepositorySystemUtils.newServiceLocator();
	defaultLocator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
	defaultLocator.addService(TransporterFactory.class, FileTransporterFactory.class);
	defaultLocator.addService(TransporterFactory.class, HttpTransporterFactory.class);


	defaultLocator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
		@Override
		public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
			exception.printStackTrace();
		}
	});

	return defaultLocator.getService(RepositorySystem.class);

}
 
開發者ID:orange-cloudfoundry,項目名稱:elpaaso-core,代碼行數:23,代碼來源:AetherConfigurer.java

示例8: newRepositorySystem

import org.eclipse.aether.spi.connector.transport.TransporterFactory; //導入依賴的package包/類
private static RepositorySystem newRepositorySystem() {
    DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
    locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
    locator.addService(TransporterFactory.class, FileTransporterFactory.class);
    locator.addService(TransporterFactory.class, HttpTransporterFactory.class);
    locator.addService(TransporterFactory.class, ClasspathTransporterFactory.class);

    locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
        @Override
        public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
            logger.error("", exception);
        }
    });

    return locator.getService(RepositorySystem.class);
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:17,代碼來源:PluginManager.java

示例9: newRepositorySystem

import org.eclipse.aether.spi.connector.transport.TransporterFactory; //導入依賴的package包/類
static RepositorySystem newRepositorySystem() {
        /*
         * Aether's components implement
         * org.sonatype.aether.spi.locator.Service to ease manual wiring and
         * using the prepopulated DefaultServiceLocator, we only need to
         * register the repository connector factories.
         */

    DefaultServiceLocator locator = new DefaultServiceLocator();
    locator.addService(ArtifactDescriptorReader.class, DefaultArtifactDescriptorReader.class);
    locator.addService(VersionResolver.class, DefaultVersionResolver.class);
    locator.addService(VersionRangeResolver.class, DefaultVersionRangeResolver.class);
    locator.addService(MetadataGeneratorFactory.class, SnapshotMetadataGeneratorFactory.class);
    locator.addService(MetadataGeneratorFactory.class, VersionsMetadataGeneratorFactory.class);
    locator.setErrorHandler(new MyErrorHandler());

    locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
    locator.addService(TransporterFactory.class, FileTransporterFactory.class);
    //locator.addService(TransporterFactory.class, WagonTransporterFactory.class);
    locator.addService(TransporterFactory.class, HttpTransporterFactory.class);


    return locator.getService(RepositorySystem.class);
}
 
開發者ID:wildfly,項目名稱:wildfly-core,代碼行數:25,代碼來源:MavenUtil.java

示例10: newRepositorySystem

import org.eclipse.aether.spi.connector.transport.TransporterFactory; //導入依賴的package包/類
/**
 * Initializes repository system
 *
 * @return repository system
 */
private static RepositorySystem newRepositorySystem() {
    DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
    locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
    locator.addService(TransporterFactory.class, FileTransporterFactory.class);
    locator.addService(TransporterFactory.class, HttpTransporterFactory.class);

    locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
        @Override
        public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
            LOGGER.error("Failed co create service {} using implementation {}", type, impl, exception);
        }
    });

    return locator.getService(RepositorySystem.class);
}
 
開發者ID:sourcegraph,項目名稱:srclib-java,代碼行數:21,代碼來源:MavenProject.java

示例11: RepositoryConnector

import org.eclipse.aether.spi.connector.transport.TransporterFactory; //導入依賴的package包/類
/**
     * @param file
     * @param system
     */
    public RepositoryConnector(File baseDir) {

        /*
         * Aether's components implement org.eclipse.aether.spi.locator.Service to ease manual wiring and using the
         * prepopulated DefaultServiceLocator, we only need to register the repository connector and transporter
         * factories.
         */
        DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
        locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
//        locator.addService(TransporterFactory.class, FileTransporterFactory.class);
        locator.addService(TransporterFactory.class, HttpTransporterFactory.class);

        locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler()
        {
            @Override
            public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
                logger.error("Could not create service {}", type, exception);
            }
        });

        system = locator.getService(RepositorySystem.class);
        session = createSession(system, baseDir);
    }
 
開發者ID:MovingBlocks,項目名稱:ModuleManager,代碼行數:28,代碼來源:RepositoryConnector.java

示例12: newRepositorySystem

import org.eclipse.aether.spi.connector.transport.TransporterFactory; //導入依賴的package包/類
public static RepositorySystem newRepositorySystem() {
	/*
	 * Aether's components implement org.eclipse.aether.spi.locator.Service
	 * to ease manual wiring and using the prepopulated
	 * DefaultServiceLocator, we only need to register the repository
	 * connector and transporter factories.
	 */
	DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
	locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
	locator.addService(TransporterFactory.class, FileTransporterFactory.class);
	locator.addService(TransporterFactory.class, HttpTransporterFactory.class);

	locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
		@Override
		public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
			exception.printStackTrace();
		}
	});

	return locator.getService(RepositorySystem.class);
}
 
開發者ID:opensourceBIM,項目名稱:BIMserver,代碼行數:22,代碼來源:RemotePluginRepository.java

示例13: newRepositorySystem

import org.eclipse.aether.spi.connector.transport.TransporterFactory; //導入依賴的package包/類
public static RepositorySystem newRepositorySystem() {
    /*
     * Aether's components implement org.eclipse.aether.spi.locator.Service to ease manual wiring and using the
     * prepopulated DefaultServiceLocator, we only need to register the repository connector and transporter
     * factories.
     */
    DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
    locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
    locator.addService(TransporterFactory.class, FileTransporterFactory.class);
    locator.addService(TransporterFactory.class, HttpTransporterFactory.class);

    locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
        @Override
        public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
            LOG.error(exception.getMessage(), exception);
        }
    });
    return locator.getService(RepositorySystem.class);
}
 
開發者ID:msoute,項目名稱:vertx-deploy-tools,代碼行數:20,代碼來源:AetherUtil.java

示例14: initServiceLocator

import org.eclipse.aether.spi.connector.transport.TransporterFactory; //導入依賴的package包/類
public static ServiceLocator initServiceLocator() {
  DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
  locator.setErrorHandler(
      new DefaultServiceLocator.ErrorHandler() {
        @Override
        public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
          throw new RuntimeException(
              String.format(
                  "Failed to initialize service %s, implemented by %s: %s",
                  type.getName(), impl.getName(), exception.getMessage()),
              exception);
        }
      });
  locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
  locator.addService(TransporterFactory.class, HttpTransporterFactory.class);
  locator.addService(TransporterFactory.class, FileTransporterFactory.class);
  // Use a no-op logger. Leaving this out would introduce a runtime dependency on log4j
  locator.addService(ILoggerFactory.class, NOPLoggerFactory.class);
  // Also requires log4j
  //    locator.addService(ILoggerFactory.class, Log4jLoggerFactory.class);
  return locator;
}
 
開發者ID:facebook,項目名稱:buck,代碼行數:23,代碼來源:AetherUtil.java

示例15: newRepositorySystem

import org.eclipse.aether.spi.connector.transport.TransporterFactory; //導入依賴的package包/類
/**
 * Set up repository system for maven.
 * 
 * @return the {@link RepositorySystemHelper}
 */
private RepositorySystem newRepositorySystem() {
  DefaultServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();

  locator.addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class);
  locator.addService(TransporterFactory.class, FileTransporterFactory.class);
  locator.addService(TransporterFactory.class, HttpTransporterFactory.class);

  locator.setErrorHandler(new DefaultServiceLocator.ErrorHandler() {
    @Override
    public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable exception) {
      exception.printStackTrace();
    }
  });

  return locator.getService(RepositorySystem.class);
}
 
開發者ID:Gemba,項目名稱:mvn-dd,代碼行數:22,代碼來源:RepositorySystemHelper.java


注:本文中的org.eclipse.aether.spi.connector.transport.TransporterFactory類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。