Tabnine Logo
EJBClientContext.create
Code IndexAdd Tabnine to your IDE (free)

How to use
create
method
in
org.jboss.ejb.client.EJBClientContext

Best Java code snippets using org.jboss.ejb.client.EJBClientContext.create (Showing top 5 results out of 315)

origin: org.jboss/jboss-remote-naming

  private EJBClientContext getContext(final Connection connection) {
    synchronized (contextByConnection) {
      EJBClientContext ret = contextByConnection.get(connection);
      if(ret == null) {
        ret = EJBClientContext.create();
        ret.registerConnection(connection);
        contextByConnection.put(connection, ret);
        connection.addCloseHandler(new CloseHandler<Connection>() {
          @Override
          public void handleClose(final Connection connection, final IOException e) {
            synchronized (contextByConnection) {
              contextByConnection.remove(connection);
            }
          }
        });
      }
      return ret;
    }
  }
}
origin: org.jboss/jboss-remote-naming

public static RemoteNamingStoreEJBClientHandler setupEJBClientContext(final Properties ejbClientProperties, final List<RemoteContext.CloseTask> closeTasks) {
  EJBClientConfiguration clientConfiguration = new PropertiesBasedEJBClientConfiguration(ejbClientProperties);
  final EJBClientContext ejbClientContext = EJBClientContext.create(clientConfiguration);
  final String ejbClientContextName = EJB_CLIENT_CONTEXT_NAME_PREFIX + nextEJBClientContextNumber.addAndGet(1);
  final EJBClientContextIdentifier ejbClientContextIdentifier = new NamedEJBClientContextIdentifier(ejbClientContextName);
  // register the context with the selector
  registerEJBClientContextWithSelector(ejbClientContextIdentifier, ejbClientContext);
  // add a close task which closes the EJB client context when the remote naming context is closed
  if (closeTasks != null) {
    closeTasks.add(new RemoteNamingEJBClientContextCloseTask(ejbClientContext));
  }
  return new RemoteNamingStoreEJBClientHandler(ejbClientContextIdentifier, ejbClientContext);
}
origin: org.jboss.as/jboss-as-ejb3

@Override
public synchronized void start(StartContext startContext) throws StartException {
  // setup the context with the receivers
  final EJBClientContext context;
  if (this.clientContextClassloader != null) {
    context = EJBClientContext.create(this.ejbClientConfiguration, this.clientContextClassloader);
  } else {
    context = EJBClientContext.create(this.ejbClientConfiguration);
  }
  // add the (optional) local EJB receiver
  final LocalEjbReceiver localEjbReceiver = this.localEjbReceiverInjectedValue.getOptionalValue();
  if (localEjbReceiver != null) {
    context.registerEJBReceiver(localEjbReceiver);
    logger.debug("Added a local EJB receiver to descriptor based EJB client context named " + startContext.getController().getName());
  }
  // now process the remoting receivers
  this.registerRemotingEJBReceivers(startContext, context);
  // we now have a fully configured EJB client context for use
  this.ejbClientContext = context;
}
origin: org.jboss.as/jboss-as-appclient

private synchronized void createConnection() {
  try {
    endpoint = Remoting.createEndpoint("endpoint", OptionMap.EMPTY);
    endpoint.addConnectionProvider("remote", new RemoteConnectionProviderFactory(), OptionMap.create(Options.SSL_ENABLED, Boolean.FALSE));
    // open a connection
    final IoFuture<Connection> futureConnection = endpoint.connect(new URI(hostUrl), OptionMap.create(Options.SASL_POLICY_NOANONYMOUS, Boolean.FALSE, Options.SASL_POLICY_NOPLAINTEXT, Boolean.FALSE), callbackHandler);
    connection = IoFutureHelper.get(futureConnection, 30L, TimeUnit.SECONDS);
    final EJBClientContext ejbClientContext = EJBClientContext.create();
    ejbClientContext.registerConnection(connection);
    this.clientContext = ejbClientContext;
  } catch (IOException e) {
    throw new RuntimeException(e);
  } catch (URISyntaxException e) {
    throw new RuntimeException(e);
  }
}
origin: org.jboss.as/jboss-as-ejb3

@Override
public synchronized void start(final StartContext context) throws StartException {
  final EJBClientContext clientContext = EJBClientContext.create(new LocalOnlyEjbClientConfiguration());
  // register the default local EJB receiver (if present - app clients don't have local EJB receivers)
  final LocalEjbReceiver localEjbReceiver = this.defaultLocalEJBReceiver.getOptionalValue();
  if (localEjbReceiver != null) {
    clientContext.registerEJBReceiver(localEjbReceiver);
  }
  this.context = clientContext;
  if (this.lockSelectorOnStart) {
    // lock the EJB client context selector
    AccessController.doPrivileged(new LockSelectorAction());
  }
  // the EJBClientContext selector is set to DefaultEJBClientContextSelector and is *locked* once
  // (in a static block of this service) so that restarting this service will not cause failures related
  // to resetting the selector. The DefaultEJBClientContextSelector is backed by a TCCLEJBClientContextSelectorService
  // which is what we set here during the service start, so that the selector has the correct service to return the
  // EJBClientContext. @see https://issues.jboss.org/browse/AS7-2998 for details
  DefaultEJBClientContextSelector.INSTANCE.setup(this.tcclEJBClientContextSelector.getValue(), this.context);
}
org.jboss.ejb.clientEJBClientContextcreate

Popular methods of EJBClientContext

  • setSelector
  • getContextManager
    Get the context manager.
  • getAttachment
  • <init>
  • calculateMethodInterceptors
  • createSession
  • createSessionCreationInvocationContext
  • getClassPathInterceptors
  • getClusterNodeSelector
  • getConfiguredConnections
    Get the pre-configured connections for this context. This information may not be used by some transp
  • getConfiguredPerClassInterceptors
  • getConfiguredPerMethodInterceptors
  • getConfiguredPerClassInterceptors,
  • getConfiguredPerMethodInterceptors,
  • getCurrent,
  • getDeploymentNodeSelector,
  • getGlobalInterceptors,
  • getInterceptors,
  • getInvocationTimeout,
  • getMaximumConnectedClusterNodes,
  • getTransportProvider

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • getContentResolver (Context)
  • scheduleAtFixedRate (Timer)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Collectors (java.util.stream)
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now