Examples of newInstance()


Examples of com.artemis.utils.reflect.Constructor.newInstance()

  @SuppressWarnings("unchecked")
  <T extends Component> T newInstance(Class<T> componentClass, boolean constructorHasWorldParameter) {
    try {
      if (constructorHasWorldParameter) {
        Constructor constructor = ClassReflection.getConstructor(componentClass, World.class);
        return (T) constructor.newInstance(world);
      } else {
        return ClassReflection.newInstance(componentClass);
      }
    } catch (ReflectionException e) {
      throw new InvalidComponentException(componentClass, "Unable to instantiate component.", e);
View Full Code Here

Examples of com.asakusafw.testdriver.JobExecutorFactory.newInstance()

     */
    @Test
    public void trivial() {
        TestDriverContext context = new TestDriverContext(getClass());
        JobExecutorFactory factory = new InProcessJobExecutorFactory();
        assertThat(factory.newInstance(context), is(instanceOf(InProcessJobExecutor.class)));
    }
}
View Full Code Here

Examples of com.asakusafw.testdriver.hadoop.ConfigurationFactory.newInstance()

        ResourceProvider provider = resource.createProvider();
        ResourceManipulator manipulator = provider.createManipulator(arguments);
        if (manipulator instanceof Configurable) {
            LOG.debug("Configuring resource manipulator: {}", manipulator);
            ConfigurationFactory configuration = ConfigurationFactory.getDefault();
            ((Configurable) manipulator).setConf(configuration.newInstance());
        }
        return manipulator;
    }

    private static GateProfile loadProfile(
View Full Code Here

Examples of com.asakusafw.yaess.core.ExecutionLockProvider.newInstance()

        conf.put(BasicLockProvider.KEY_DIRECTORY, lockDir.getAbsolutePath());

        ServiceProfile<ExecutionLockProvider> profile = new ServiceProfile<ExecutionLockProvider>(
                "testing", BasicLockProvider.class, conf, ProfileContext.system(getClass().getClassLoader()));
        ExecutionLockProvider instance = profile.newInstance();
        ExecutionLock lock = instance.newInstance("batch");
        try {
            lock.beginFlow("flow", "exec");
            assertThat(lockDir.list().length, is(greaterThan(start)));
        } finally {
            lock.close();
View Full Code Here

Examples of com.asakusafw.yaess.core.ExecutionMonitorProvider.newInstance()

        Map<String, String> conf = new HashMap<String, String>();
        ServiceProfile<ExecutionMonitorProvider> profile = new ServiceProfile<ExecutionMonitorProvider>(
                "testing", BasicMonitorProvider.class, conf, ProfileContext.system(getClass().getClassLoader()));

        ExecutionMonitorProvider instance = profile.newInstance();
        ExecutionMonitor monitor = instance.newInstance(CONTEXT);
        monitor.open(3);
        try {
            monitor.progressed(1);
            monitor.progressed(1);
            monitor.progressed(1);
View Full Code Here

Examples of com.atlassian.crowd.integration.rest.service.factory.RestCrowdClientFactory.newInstance()

            synchronized (CrowdUtils.class) {
                if (authenticator == null) {
                    ClientResourceLocator clientResourceLocator = new ClientResourceLocator("crowd.properties");
                    ClientProperties props = ClientPropertiesImpl.newInstanceFromResourceLocator(clientResourceLocator);
                    CrowdClientFactory clientFactory = new RestCrowdClientFactory();
                    CrowdClient client = clientFactory.newInstance(props);
                    CrowdHttpTokenHelper tokenHelper = CrowdHttpTokenHelperImpl
                            .getInstance(CrowdHttpValidationFactorExtractorImpl.getInstance());
                    authenticator = new CrowdHttpAuthenticatorImpl(client, props, tokenHelper);
                }
            }
View Full Code Here

Examples of com.atlassian.crowd.service.factory.CrowdClientFactory.newInstance()

            synchronized (CrowdUtils.class) {
                if (authenticator == null) {
                    ClientResourceLocator clientResourceLocator = new ClientResourceLocator("crowd.properties");
                    ClientProperties props = ClientPropertiesImpl.newInstanceFromResourceLocator(clientResourceLocator);
                    CrowdClientFactory clientFactory = new RestCrowdClientFactory();
                    CrowdClient client = clientFactory.newInstance(props);
                    CrowdHttpTokenHelper tokenHelper = CrowdHttpTokenHelperImpl
                            .getInstance(CrowdHttpValidationFactorExtractorImpl.getInstance());
                    authenticator = new CrowdHttpAuthenticatorImpl(client, props, tokenHelper);
                }
            }
View Full Code Here

Examples of com.badlogic.gdx.utils.reflect.Constructor.newInstance()

    } catch (Exception ex) {
      try {
        // Try a private constructor.
        Constructor constructor = ClassReflection.getDeclaredConstructor(type);
        constructor.setAccessible(true);
        return constructor.newInstance();
      } catch (SecurityException ignored) {
      } catch (ReflectionException ignored) {
        if (type.isEnum()) {
          return type.getEnumConstants()[0];
        }
View Full Code Here

Examples of com.badlogic.gwtref.client.Type.newInstance()

  }

  protected T newObject () {
    Type t = ReflectionCache.getType(type);
    try {
      return (T)t.newInstance();
    } catch (Exception ex) {
      throw new GdxRuntimeException("Unable to create new instance: " + type.getName(), ex);
    }
  }
}
View Full Code Here

Examples of com.betfair.cougar.netutil.SslContextFactory.newInstance()

                    }
                }
            }
            SSLFilter sslFilter = null;
            if (supportsTls) {
                sslFilter = new SSLFilter(factory.newInstance());
                sslFilter.setWantClientAuth(wantClientAuth);
                sslFilter.setNeedClientAuth(needClientAuth);
                sslFilter.setUseClientMode(!isServer);
                String[] cipherSuites = allowedCipherSuites == null || "".equals(allowedCipherSuites.trim()) ? null : allowedCipherSuites.split(",");
                if (cipherSuites != null) {
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.