Examples of ContextFactory


Examples of com.arjuna.wsc.ContextFactory

  public void removeContextFactory (String coordinationTypeURI)
  {
    try
    {
      ContextFactory contextFactory = (ContextFactory) _protocols.removeProtocol(convert(coordinationTypeURI));

      contextFactory.uninstall(coordinationTypeURI);
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
    }
View Full Code Here

Examples of com.arjuna.wsc11.ContextFactory

    {
        final ContextFactoryMapper contextFactoryMapper = ContextFactoryMapper.getFactory() ;
        try
        {
            final String coordinationType = createCoordinationContext.getCoordinationType() ;
            final ContextFactory contextFactory = contextFactoryMapper.getContextFactory(coordinationType) ;
           
            if (contextFactory != null)
            {
                final CoordinationContext coordinationContext ;
                try
                {
                    final Expires expiresElement = createCoordinationContext.getExpires() ;
                    final Long expires = (expiresElement == null ? null : new Long(expiresElement.getValue())) ;
                   
                    coordinationContext = contextFactory.create(coordinationType, expires, createCoordinationContext.getCurrentContext(), isSecure) ;
                    final CreateCoordinationContextResponseType response = new CreateCoordinationContextResponseType() ;
                    response.setCoordinationContext(coordinationContext) ;
                    return response;
                }
                catch (final InvalidCreateParametersException invalidCreateParametersException)
View Full Code Here

Examples of com.cognifide.slice.api.context.ContextFactory

   * @param resolver Resolver used to provide context
   * @return Created injector
   */
  public static InjectorWithContext getInjector(String injectorName, ResourceResolver resolver) {
    InjectorWithContext injector = resolver.adaptTo(InjectorsRepository.class).getInjector(injectorName);
    ContextFactory factory = injector.getInstance(ContextFactory.class);
    Context context = factory.getResourceResolverContext(resolver);
    injector.pushContextProvider(new ConstantContextProvider(context));
    return injector;
  }
View Full Code Here

Examples of net.sf.laja.context.ContextFactory

  public Set(Source source, Namespaces namespaces, TemplateTextWriter templateTextWriter, Macro macro, Context context) {
    this.macro = macro;
    this.context = context;
    this.source = source;
    this.namespaces = namespaces;
    this.contextFactory = new ContextFactory(namespaces, templateTextWriter);
  }
View Full Code Here

Examples of net.sourceforge.htmlunit.corejs.javascript.ContextFactory

        final String scriptName = requestSettings.getUrl().toString();
        final String scriptSource = response.getContentAsString();

        // skip if it is already formatted? => TODO

        final ContextFactory factory = new ContextFactory();
        final ContextAction action = new ContextAction() {
            public Object run(final Context cx) {
                cx.setOptimizationLevel(-1);
                final Script script = cx.compileString(scriptSource, scriptName, 0, null);
                return cx.decompileScript(script, 4);
            }
        };

        try {
            final String decompileScript = (String) factory.call(action);
            final WebResponseData wrd = new WebResponseData(decompileScript.getBytes(), response.getStatusCode(),
                response.getStatusMessage(), response.getResponseHeaders());
            return new WebResponseImpl(wrd, response.getRequestSettings().getUrl(),
                response.getRequestSettings().getHttpMethod(), response.getLoadTime());
        }
View Full Code Here

Examples of org.apache.hadoop.metrics.ContextFactory

    return new ThriftMetrics(
        ThriftServerRunner.DEFAULT_LISTEN_PORT, conf, Hbase.Iface.class);
  }

  private static void setupMetricsContext() throws Exception {
    ContextFactory factory = ContextFactory.getFactory();
    factory.setAttribute(ThriftMetrics.CONTEXT_NAME + ".class",
        NoEmitMetricsContext.class.getName());
    MetricsUtil.getContext(ThriftMetrics.CONTEXT_NAME)
               .createRecord(ThriftMetrics.CONTEXT_NAME).remove();
  }
View Full Code Here

Examples of org.apache.hadoop.metrics.ContextFactory

    setupMetricsContext();
    return new ThriftMetrics(ThriftServerRunner.DEFAULT_LISTEN_PORT, conf, Hbase.Iface.class);
  }

  private static void setupMetricsContext() throws IOException {
    ContextFactory factory = ContextFactory.getFactory();
    factory.setAttribute(ThriftMetrics.CONTEXT_NAME + ".class",
        NoEmitMetricsContext.class.getName());
    MetricsUtil.getContext(ThriftMetrics.CONTEXT_NAME)
               .createRecord(ThriftMetrics.CONTEXT_NAME).remove();
  }
View Full Code Here

Examples of org.apache.hadoop.metrics.ContextFactory

    return new ThriftMetrics(Integer.parseInt(ThriftServer.DEFAULT_LISTEN_PORT),
        conf, THBaseService.Iface.class);
  }
  private static void setupMetricsContext() throws IOException {
    ContextFactory factory = ContextFactory.getFactory();
    factory.setAttribute(ThriftMetrics.CONTEXT_NAME + ".class",
        NoEmitMetricsContext.class.getName());
    MetricsUtil.getContext(ThriftMetrics.CONTEXT_NAME)
               .createRecord(ThriftMetrics.CONTEXT_NAME).remove();
  }
View Full Code Here

Examples of org.apache.hadoop.metrics.ContextFactory

  private static Log LOG = LogFactory.getLog(TestRpcMetrics.class);

  @BeforeClass
  public static void setupBeforeClass() throws Exception {
    // set custom metrics context
    ContextFactory factory = ContextFactory.getFactory();
    factory.setAttribute("rpc.class", MockMetricsContext.class.getName());
    // make sure metrics context is setup, otherwise updating won't start
    MetricsContext ctx = MetricsUtil.getContext("rpc");
    assertTrue("Wrong MetricContext implementation class",
        (ctx instanceof MockMetricsContext));
View Full Code Here

Examples of org.apache.hadoop.metrics.ContextFactory

    }
    waitTaskTrackers();
  }

  private void setNoEmitMetricsContext() throws IOException {
    ContextFactory factory = ContextFactory.getFactory();
    factory.setAttribute(ClusterManagerMetrics.CONTEXT_NAME + ".class",
        NoEmitMetricsContext.class.getName());
  }
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.