This method helps in obtaining the topic factory

@return the factory for the factory to get topic connections from
488361
public TopicConnectionFactory getTopicConnectionFactory(String topicConnFactoryName) throws ServiceLocatorException {
		TopicConnectionFactory factory = null;
		try {
			factory = (TopicConnectionFactory) ic.lookup(topicConnFactoryName);
		} catch (NamingException ne) {
			throw new ServiceLocatorException(ne);
		} catch (Exception e) {
			throw new ServiceLocatorException(e);
		}
		return factory;
	}
5811
public static NlsMessageFactory getFactory() {

    if (factory == null) {
      synchronized (NlsAccess.class) {
        if (factory == null) {
          NlsMessageFactoryImpl factoryImpl = new NlsMessageFactoryImpl();
          factoryImpl.initialize();
          factory = factoryImpl;
        }
      }
    }
    return factory;
  }
754637
protected final SerializerFactory findSerializerFactory()
    {
        SerializerFactory factory = _serializerFactory;

        if (factory == null) {
            factory = SerializerFactory.createDefault();
            _defaultSerializerFactory = factory;
            _serializerFactory = factory;
        }

        return factory;
    }
351806
public static final TermFactory getTermFactory() {
		if (tf == null) {
			try {
				@SuppressWarnings("unchecked")
				Class<? extends TermFactory> clazz = (Class<? extends TermFactory>) Class
						.forName(DEFAULT_TERM_FACTORY);
				Method m = clazz.getMethod("getInstance");
				registerTermFactory((TermFactory) m.invoke(null));
				log.debug("Retrived {} as default TermFactory implementation.",
						DEFAULT_TERM_FACTORY);
			} catch (Exception e) {
				log.error("Unable to get TermFactory from default", e);
				throw new RuntimeException(
						"No TermFactory implementation registered!");
			}
		}
		return tf;
	}
707512
@Override
  public <T> ConnectionFactory<T> getConnectionFactory(final Identifier connFactoryId) {
    final ConnectionFactory<T> connFactory = connFactoryMap.get(connFactoryId.toString());
    if (connFactory == null) {
      throw new RuntimeException("Cannot find ConnectionFactory of " + connFactoryId + ".");
    }
    return connFactory;
  }
300753
@Override
    public ChannelPipelineFactory getPipelineFactory()
    {
        return new ChannelPipelineFactory()
        {
            @Override
            public ChannelPipeline getPipeline()
                    throws Exception
            {
                final ChannelPipeline cp = Channels.pipeline();
                cp.addLast(FRAME_DECODER, new FixedLengthFrameDecoder(8));
                cp.addLast(HANDSHAKE, new Socks4HandshakeHandler(Socks4ClientBootstrap.super.getPipelineFactory()));
                return cp;
            }
        };
    }
602801
private SocketFactory getFactory(int index) throws ConnectException {
        synchronized (mFactories) {
            int size = mFactories.size();
            if (size <= 0) {
                throw new ConnectException("No SocketFactories available");
            }
            return (SocketFactory)mFactories.get(index % size);
        }
    }
460136
protected ThreadFactory getThreadFactory() {
        return new ThreadFactory() {
            private final ThreadFactory parent = Executors.defaultThreadFactory();
            private final AtomicInteger tid = new AtomicInteger(1);

            @Override
            public Thread newThread(final Runnable task) {
              final Thread t = parent.newThread(task);
              t.setName(THREAD_PREFIX + tid.getAndIncrement());
              return t;
            }
          };
    }
972769
public <T> TopicProducer<T> createTopicProducer(final String topic, final ProducerCallback<T> messageCallback)
    {
        Preconditions.checkState(connectionFactory != null, "connection factory was never injected!");
        return new TopicProducer<T>(connectionFactory, jmsConfig, topic, messageCallback);
    }
1106677
public Object createConnectionFactory() throws NotSupportedException {

        // Non-managed use is not supported
        final NotSupportedException exception = new NotSupportedException(NLS
                .getString("NON_MANAGED_ENVIRONMENT_CWSIV0351"));
        if (TRACE.isEventEnabled()) {
            SibTr.exception(this, TRACE, exception);
        }
        throw exception;

    }
282945
public String getTopic() {
        Object topic = getHeader(KafkaMessageHeaders.TOPIC);

        if (topic != null) {
            return topic.toString();
        }

        return null;
    }
10377
public JdbcMapperFactory getterFactory(final GetterFactory<ResultSet, JdbcColumnKey> getterFactory) {
		return addGetterFactory(new ContextualGetterFactoryAdapter<ResultSet, JdbcColumnKey>(getterFactory));
	}
42100
public static LazyProxyFactory createDefaultProxyFactory() {
        if (testDependencyFullFilled()) {
            final String factoryClassName = "dev.morphia.mapping.lazy.CGLibLazyProxyFactory";
            try {
                return (LazyProxyFactory) Class.forName(factoryClassName).newInstance();
            } catch (Exception e) {
                LOG.error("While instantiating " + factoryClassName, e);
            }
        }
        return null;
    }
1060109
public static DSFactory get() {
		if (null == factory) {
			synchronized (lock) {
				if (null == factory) {
					factory = DSFactory.create(null);
				}
			}
		}
		return factory;
	}
129946
public FacesConfigFactoryType<FacesConfigType<T>> getOrCreateFactory()
   {
      List<Node> nodeList = childNode.get("factory");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigFactoryTypeImpl<FacesConfigType<T>>(this, "factory", childNode, nodeList.get(0));
      }
      return createFactory();
   }
1223647
public static function getFactory()
    {
        if (self::$nb_provider_factory === null) {
            self::$nb_provider_factory = new CNabuProviderFactory();
            self::$nb_provider_factory->init();
        }

        return self::$nb_provider_factory;
    }
295862
public MessageProducer getOrCreateProducer(final String topic) {
        if (!this.shareProducer) {
            FutureTask<MessageProducer> task = this.producers.get(topic);
            if (task == null) {
                task = new FutureTask<MessageProducer>(new Callable<MessageProducer>() {

                    @Override
                    public MessageProducer call() throws Exception {
                        MessageProducer producer = MetaqTemplate.this.messageSessionFactory.createProducer();
                        producer.publish(topic);
                        if (!StringUtils.isBlank(MetaqTemplate.this.defaultTopic)) {
                            producer.setDefaultTopic(MetaqTemplate.this.defaultTopic);
                        }
                        return producer;
                    }

                });
                FutureTask<MessageProducer> oldTask = this.producers.putIfAbsent(topic, task);
                if (oldTask != null) {
                    task = oldTask;
                }
                else {
                    task.run();
                }
            }

            try {
                MessageProducer producer = task.get();
                return producer;
            }
            catch (ExecutionException e) {
                throw ThreadUtils.launderThrowable(e.getCause());
            }
            catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
        }
        else {
            if (this.sharedProducer == null) {
                synchronized (this) {
                    if (this.sharedProducer == null) {
                        this.sharedProducer = this.messageSessionFactory.createProducer();
                        if (!StringUtils.isBlank(this.defaultTopic)) {
                            this.sharedProducer.setDefaultTopic(this.defaultTopic);
                        }
                    }
                }
            }
            this.sharedProducer.publish(topic);
            return this.sharedProducer;
        }
        throw new IllegalStateException("Could not create producer for topic '" + topic + "'");
    }