FactoryClient constructor.
353023
public function getMolecule(string $canonicalSMILE)
    {

        $this->operations = new Operations();

        $atoms = array();

        // Recursive. $atoms is passed by reference.
        $this->operations->addBranches($canonicalSMILE, $atoms);

        $this->operations->addLoopBonds($atoms);

        $this->operations->atomsToCanonicalSMILE($atoms);


        $factoryType = "";

        // Logic to determine what type of factory eg AlkeneFactory, AmineFactory, MoleculeFactory
        if (strpos($canonicalSMILE, "C=C")!==false) {
            $factoryType = "AlkeneFactory";
        }

        switch($factoryType) {
            case "AlkeneFactory":
                $factory = new AlkeneFactory($atoms);
                break;
            default:
                $factory = new MoleculeFactory($atoms);
                break;
        }
        $molecule = $factory->getMolecule();
        return $molecule;
    }
107474
def make_factory(klass, **kwargs):
    """"""
    factory_name = '%sFactory' % klass.__name__

    class Meta:
        model = klass

    kwargs['Meta'] = Meta
    base_class = kwargs.pop('FACTORY_CLASS', base.Factory)

    factory_class = type(base.Factory).__new__(type(base.Factory), factory_name, (base_class,), kwargs)
    factory_class.__name__ = '%sFactory' % klass.__name__
    factory_class.__doc__ = 'Auto-generated factory for class %s' % klass
    return factory_class
463474
private function buildClient(
        RequestFactoryInterface $factory,
        SenderInterface $sender,
        LoggerInterface $logger,
        $service
    ) {
        return $service !== null
            ? new ServiceClient($factory, $sender, $logger, $service)
            : new MultiClient($factory, $sender, $logger);
    }
1147911
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
        in.defaultReadObject();
        this.factoryLoader = ServiceLoader.load(PropertyFactory.class, PropertyFactory.class.getClassLoader());
    }
494243
public Object create(Object locator) throws CreateException {
		if (locator == null)
			throw new NullPointerException("Locator cannot be null");

		// Iterate from the latest factories
		for (int index = _factories.size() - 1; index >= 0; index--) {
			IFactory factory = _factories.get(index);
			if (factory.canCreate(locator) != null)
				return factory.create(locator);
		}

		throw new CreateException(null, locator);
	}
190030
@Bean
    public ArmeriaClientConfigurator armeriaClientConfigurator(ClientFactory clientFactory) {
        // Customize the client using the given HttpClientBuilder. For example:
        return builder -> {
            // Use a circuit breaker for each remote host.
            final CircuitBreakerStrategy strategy = CircuitBreakerStrategy.onServerErrorStatus();
            builder.decorator(new CircuitBreakerHttpClientBuilder(strategy).newDecorator());

            // Set a custom client factory.
            builder.factory(clientFactory);
        };
    }
792034
public static Factory newInstance() {
        ScheduledExecutorService scheduler = newSingleThreadScheduledExecutor(new ThreadFactory() {
            public Thread newThread(Runnable r) {
                Thread result = new Thread(r);
                result.setDaemon(true);
                return result;
            }
        });
        Properties props = new Properties();
        return new DefaultFactory(scheduler, props);
    }
508114
public FactoryFactory build() {
        return new FactoryFactory(
                getJceProvider(),
                getHttpClient(),
                getKeyCache(),
                getApiBaseURL(),
                getApiIdentifier(),
                getRequestExpireSeconds(),
                offsetTTL,
                currentPublicKeyTTL,
                entityKeyMap
        );

    }
1371028
def factory(cls, endpoint, timeout, *args, **kwargs):
        
        start = time.time()
        kwargs['connect_timeout'] = timeout
        conn = cls(endpoint, *args, **kwargs)
        elapsed = time.time() - start
        conn.connected_event.wait(timeout - elapsed)
        if conn.last_error:
            if conn.is_unsupported_proto_version:
                raise ProtocolVersionUnsupported(endpoint, conn.protocol_version)
            raise conn.last_error
        elif not conn.connected_event.is_set():
            conn.close()
            raise OperationTimedOut("Timed out creating connection (%s seconds)" % timeout)
        else:
            return conn
705096
public T build() {
        C clientObject = client;
        if (clientObject == null) {
            clientObject = createClient();
        }

        return factory.create(clientObject);
    }
718809
private Object instantiate(Class actualType, JSONObject j) {
        Object r = bindInterceptor.instantiate(actualType,j);
        if (r!=BindInterceptor.DEFAULT) return r;
        for (BindInterceptor bi : getWebApp().bindInterceptors) {
            r = bi.instantiate(actualType,j);
            if (r!=BindInterceptor.DEFAULT) return r;
        }

        if (actualType==JSONObject.class || actualType==JSON.class) return actualType.cast(j);

        String[] names = new ClassDescriptor(actualType).loadConstructorParamNames();

        // the actual arguments to invoke the constructor with.
        Object[] args = new Object[names.length];

        // constructor
        Constructor c = findConstructor(actualType, names.length);
        Class[] types = c.getParameterTypes();
        Type[] genTypes = c.getGenericParameterTypes();

        // convert parameters
        for( int i=0; i<names.length; i++ ) {
            try {
                args[i] = bindJSON(genTypes[i],types[i],j.get(names[i]));
            } catch (IllegalArgumentException e) {
                throw new IllegalArgumentException("Failed to convert the "+names[i]+" parameter of the constructor "+c,e);
            }
        }

        Object o = injectSetters(invokeConstructor(c, args), j, Arrays.asList(names));
        o = bindResolve(o,j);

        return o;
    }
1106792
void compile() {
    TypeInfo factoryType = innerClasses.registerInnerClass(FACTORY_CLASS, FACTORY_ACCESS);
    SoyClassWriter cw =
        SoyClassWriter.builder(factoryType)
            .implementing(FACTORY_TYPE)
            .setAccess(FACTORY_ACCESS)
            .sourceFileName(templateNode.getSourceLocation().getFileName())
            .build();
    innerClasses.registerAsInnerClass(cw, factoryType);

    generateStaticInitializer(cw);
    defineDefaultConstructor(cw, factoryType);
    generateCreateMethod(cw, factoryType);
    cw.visitEnd();
    innerClasses.add(cw.toClassData());
  }
239405
private static void createFactoryInstance() {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createFactoryInstance");
    try {
      Class cls = Class.forName(JS_MESSAGE_HANDLE_FACTORY_CLASS);
      instance = (JsMessageHandleFactory) cls.newInstance();
    }
    catch (Exception e) {
      FFDCFilter.processException(e, "com.ibm.ws.sib.mfp.JsMessageHandleFactory.createFactoryInstance", "133");
      SibTr.error(tc,"UNABLE_TO_CREATE_HANDLEFACTORY_CWSIF0031",e);
      NoClassDefFoundError ncdfe = new NoClassDefFoundError(e.getMessage());
      ncdfe.initCause(e);
      throw ncdfe;
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createFactoryInstance");
  }
903168
def factory(arg1, arg2, version=-1, forceviewserveruse=False, windowId=None, uiAutomatorHelper=None):
        '''
        
        '''

        if DEBUG_VIEW_FACTORY:
            print >> sys.stderr, "View.factory(%s, %s, %s, %s, %s, %s)" % (arg1, arg2, version, forceviewserveruse, windowId, uiAutomatorHelper)
        if type(arg1) == types.ClassType:
            cls = arg1
            attrs = None
        else:
            cls = None
            attrs = arg1
        if isinstance(arg2, View):
            view = arg2
            device = None
        else:
            device = arg2
            view = None

        if attrs and attrs.has_key('class'):
            clazz = attrs['class']
            if DEBUG_VIEW_FACTORY:
                print >> sys.stderr, "    View.factory: creating View with specific class: %s" % clazz
            if clazz == 'android.widget.TextView':
                return TextView(attrs, device, version, forceviewserveruse, windowId, uiAutomatorHelper)
            elif clazz == 'android.widget.EditText':
                return EditText(attrs, device, version, forceviewserveruse, windowId, uiAutomatorHelper)
            elif clazz == 'android.widget.ListView':
                return ListView(attrs, device, version, forceviewserveruse, windowId, uiAutomatorHelper)
            else:
                return View(attrs, device, version, forceviewserveruse, windowId, uiAutomatorHelper)
        elif cls:
            if view:
                return cls.__copy(view)
            else:
                return cls(attrs, device, version, forceviewserveruse, windowId, uiAutomatorHelper)
        elif view:
            return copy.copy(view)
        else:
            if DEBUG_VIEW_FACTORY:
                print >> sys.stderr, "    View.factory: creating generic View"
            return View(attrs, device, version, forceviewserveruse, windowId, uiAutomatorHelper)
1186860
def of(self, klass, name="default"):
        
        return FactoryBuilder(
            klass, name, self._definitions, self._faker, self._resolver
        )
1170967
protected <T> T instantiate(String name, ClassLoader classLoader) {
    try {
      Class<?> generatedClass = loadClass(classLoader, name);
      if (generatedClass == Void.class) {
        return null;
      }
      @SuppressWarnings("unchecked")
      T instance = (T) generatedClass.newInstance();
      return instance;
    } catch (InstantiationException e) {
      throw new RuntimeException("Failed to initialize " + name, e);
    } catch (IllegalAccessException e) {
      throw new RuntimeException("Failed to initialize " + name, e);
    }
  }
439034
protected final CommPortConnectionFactory createCommPortConnectionFactory()
    {
        //create new instance
        CommPortConnectionFactory factory=(CommPortConnectionFactory)ReflectionHelper.createInstance(this.commConnectionFactoryClassName);
            
        //initialize
        factory.initialize(this);
        
        return factory;
    }