Codota Logo
org.jboss.as.ejb3.pool
Code IndexAdd Codota to your IDE (free)

How to use org.jboss.as.ejb3.pool

Best Java code snippets using org.jboss.as.ejb3.pool (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: wildfly/wildfly

protected void destroy(T bean) {
  doRemove(bean);
}
origin: wildfly/wildfly

  @Override
  public void handleRollback(OperationContext context, ModelNode operation) {
    pool.setMaxSize(oldSize);
  }
});
origin: wildfly/wildfly

@Override
public EJBBoundPoolMetaData parse(final XMLStreamReader reader, final PropertyReplacer propertyReplacer) throws XMLStreamException {
  final String element = reader.getLocalName();
  // we only parse <pool> (root) element
  if (!ROOT_ELEMENT_POOL.equals(element)) {
    throw unexpectedElement(reader);
  }
  final EJBBoundPoolMetaData ejbBoundPoolMetaData = new EJBBoundPoolMetaData();
  this.processElements(ejbBoundPoolMetaData, reader, propertyReplacer);
  return ejbBoundPoolMetaData;
}
origin: wildfly/wildfly

final ModelNode result = context.getResult();
if (pool != null) {
  result.set(pool.getAvailableCount());
final ModelNode result = context.getResult();
if (pool != null) {
  result.set(pool.getCreateCount());
final ModelNode result = context.getResult();
if (pool != null) {
  result.set(pool.getRemoveCount());
final ModelNode result = context.getResult();
if (pool != null) {
  result.set(pool.getCurrentSize());
final ModelNode result = context.getResult();
if (pool != null) {
  result.set(pool.getMaxSize());
origin: wildfly/wildfly

  @Override
  protected void processElement(final EJBBoundPoolMetaData poolMetaData, final XMLStreamReader reader, final PropertyReplacer propertyReplacer) throws XMLStreamException {
    final String namespaceURI = reader.getNamespaceURI();
    final String elementName = reader.getLocalName();
    // if it doesn't belong to our namespace then let the super handle this
    if (!NAMESPACE_URI.equals(namespaceURI)) {
      super.processElement(poolMetaData, reader, propertyReplacer);
      return;
    }
    if (ELEMENT_BEAN_INSTANCE_POOL_REF.equals(elementName)) {
      final String poolName = getElementText(reader, propertyReplacer);
      // set the pool name in the metadata
      poolMetaData.setPoolName(poolName);
    } else {
      throw unexpectedElement(reader);
    }
  }
}
origin: wildfly/wildfly

@Override
public Object processInvocation(InterceptorContext context) throws Exception {
  PooledComponent<ComponentInstance> component = (PooledComponent<ComponentInstance>) getComponent(context, EJBComponent.class);
  ComponentInstance instance = component.getPool().get();
  context.putPrivateData(ComponentInstance.class, instance);
  boolean discarded = false;
      component.getPool().discard(instance);
    component.getPool().discard(instance);
    throw e;
  } catch (final Throwable t) {
    discarded = true;
    component.getPool().discard(instance);
    throw new RuntimeException(t);
  }  finally {
    if (!discarded) {
      component.getPool().release(instance);
origin: wildfly/wildfly

@Override
protected void handleDeploymentDescriptor(DeploymentUnit deploymentUnit, DeploymentReflectionIndex deploymentReflectionIndex, Class<?> componentClass, T description) throws DeploymentUnitProcessingException {
  final String ejbName = description.getEJBName();
  final EjbJarMetaData metaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
  if (metaData == null) {
    return;
  }
  final AssemblyDescriptorMetaData assemblyDescriptor = metaData.getAssemblyDescriptor();
  if (assemblyDescriptor == null) {
    return;
  }
  // get the pool metadata
  final List<EJBBoundPoolMetaData> pools = assemblyDescriptor.getAny(EJBBoundPoolMetaData.class);
  String poolName = null;
  if (pools != null) {
    for (final EJBBoundPoolMetaData poolMetaData : pools) {
      // if this applies for all EJBs and if there isn't a pool name already explicitly specified
      // for the specific bean (i.e. via an ejb-name match)
      if ("*".equals(poolMetaData.getEjbName()) && poolName == null) {
        poolName = poolMetaData.getPoolName();
      } else if (ejbName.equals(poolMetaData.getEjbName())) {
        poolName = poolMetaData.getPoolName();
      }
    }
  }
  if (poolName != null) {
    this.setPoolName(description, poolName);
  }
}
origin: wildfly/wildfly

protected void executeWriteAttribute(String attributeName, OperationContext context, ModelNode operation, T component,
                   PathAddress address) throws OperationFailedException {
  if (componentType.hasPool() && POOL_MAX_SIZE.getName().equals(attributeName)) {
    int newSize = POOL_MAX_SIZE.resolveValue(context, operation.get(VALUE)).asInt();
    final Pool<?> pool = componentType.getPool(component);
    final int oldSize = pool.getMaxSize();
    componentType.getPool(component).setMaxSize(newSize);
    context.completeStep(new OperationContext.RollbackHandler() {
      @Override
      public void handleRollback(OperationContext context, ModelNode operation) {
        pool.setMaxSize(oldSize);
      }
    });
  } else {
    // Bug; we were registered for an attribute but there is no code for handling it
    throw EjbLogger.ROOT_LOGGER.unknownAttribute(attributeName);
  }
}
origin: org.jboss.as/jboss-as-ejb3

public EntityBeanComponentInstance acquireUnAssociatedInstance() {
  if (pool != null) {
    return pool.get();
  } else {
    return factory.create();
  }
}
origin: org.jboss.as/jboss-as-ejb3

public void releaseEntityBeanInstance(final EntityBeanComponentInstance instance) {
  if (pool != null) {
    pool.release(instance);
  } else {
    factory.destroy(instance);
  }
}
origin: wildfly/wildfly

@Override
public void init() {
  super.init();
  if(this.pool!=null){
    this.pool.start();
  }
}
origin: wildfly/wildfly

@Override
public void done() {
  if(this.pool!=null){
    this.pool.stop();
  }
  super.done();
}
origin: wildfly/wildfly

protected T create() {
  T bean = factory.create();
  createCount.incrementAndGet();
  return bean;
}
origin: wildfly/wildfly

  /**
   * Remove the bean context and invoke any callbacks
   * and track the remove count
   *
   * @param bean
   */
  protected void doRemove(T bean) {
    try {
      factory.destroy(bean);
    } finally {
      removeCount.incrementAndGet();
    }
  }
}
origin: wildfly/wildfly

  static Map<String, AbstractMetaDataParser<?>> createJbossEjbJarParsers() {
    Map<String, AbstractMetaDataParser<?>> parsers = new HashMap<String, AbstractMetaDataParser<?>>();
    for (ClusteringSchema schema : EnumSet.allOf(ClusteringSchema.class)) {
      parsers.put(schema.getNamespaceUri(), new EJBBoundClusteringMetaDataParser(schema));
    }
    parsers.put(EJBBoundSecurityMetaDataParser.LEGACY_NAMESPACE_URI, EJBBoundSecurityMetaDataParser.INSTANCE);
    parsers.put(EJBBoundSecurityMetaDataParser.NAMESPACE_URI_1_0, EJBBoundSecurityMetaDataParser.INSTANCE);
    parsers.put(EJBBoundSecurityMetaDataParser11.NAMESPACE_URI_1_1, EJBBoundSecurityMetaDataParser11.INSTANCE);
    parsers.put(SecurityRoleMetaDataParser.LEGACY_NAMESPACE_URI, SecurityRoleMetaDataParser.INSTANCE);
    parsers.put(SecurityRoleMetaDataParser.NAMESPACE_URI, SecurityRoleMetaDataParser.INSTANCE);
    parsers.put(EJBBoundResourceAdapterBindingMetaDataParser.LEGACY_NAMESPACE_URI, EJBBoundResourceAdapterBindingMetaDataParser.INSTANCE);
    parsers.put(EJBBoundResourceAdapterBindingMetaDataParser.NAMESPACE_URI, EJBBoundResourceAdapterBindingMetaDataParser.INSTANCE);
    parsers.put(EJBBoundMdbDeliveryMetaDataParser.NAMESPACE_URI_1_0, EJBBoundMdbDeliveryMetaDataParser.INSTANCE);
    parsers.put(EJBBoundMdbDeliveryMetaDataParser11.NAMESPACE_URI_1_1, EJBBoundMdbDeliveryMetaDataParser11.INSTANCE);
    parsers.put("urn:iiop", new IIOPMetaDataParser());
    parsers.put("urn:iiop:1.0", new IIOPMetaDataParser());
    parsers.put("urn:trans-timeout", new TransactionTimeoutMetaDataParser());
    parsers.put("urn:trans-timeout:1.0", new TransactionTimeoutMetaDataParser());
    parsers.put(EJBBoundPoolParser.NAMESPACE_URI, new EJBBoundPoolParser());
    parsers.put(EJBBoundCacheParser.NAMESPACE_URI, new EJBBoundCacheParser());
    parsers.put(ContainerInterceptorsParser.NAMESPACE_URI_1_0, ContainerInterceptorsParser.INSTANCE);
    parsers.put(TimerServiceMetaDataParser.NAMESPACE_URI, TimerServiceMetaDataParser.INSTANCE);
    return parsers;
  }
}
origin: wildfly/wildfly

@Deprecated
protected void remove(T bean) {
  this.doRemove(bean);
}
origin: wildfly/wildfly

@Override
public void init() {
  if (endpoint == null) {
    throw EjbLogger.ROOT_LOGGER.endpointUnAvailable(this.getComponentName());
  }
  super.init();
  suspendController.registerActivity(serverActivity);
  if (this.pool != null) {
    this.pool.start();
  }
}
origin: wildfly/wildfly

@Override
public void done() {
  synchronized (this) {
    if (this.deliveryActive) {
      this.deactivate();
    }
    this.started = false;
  }
  if (this.pool != null) {
    this.pool.stop();
  }
  suspendController.unRegisterActivity(serverActivity);
  super.done();
}
origin: wildfly/wildfly

public void discard(T ctx) {
  if (ROOT_LOGGER.isTraceEnabled()) {
    ROOT_LOGGER.tracef("Discard instance %s#%s", this, ctx);
  }
  // If we block when maxSize instances are in use, invoke release on strictMaxSize
  semaphore.release();
  // Let the super do any other remove stuff
  super.doRemove(ctx);
}
origin: wildfly/wildfly

@Override
@Deprecated
public void remove(T ctx) {
  if (ROOT_LOGGER.isTraceEnabled()) {
    ROOT_LOGGER.tracef("Removing instance: %s#%s", this, ctx);
  }
  semaphore.release();
  // let the super do the other remove stuff
  super.doRemove(ctx);
}
org.jboss.as.ejb3.pool

Most used classes

  • AbstractPool
    The base of all pool implementations.
  • EJBBoundPoolMetaData
    Metadata represents the pool name configured for EJBs via the jboss-ejb3.xml deployment descriptor
  • EJBBoundPoolParser
    Parser for urn:ejb-pool namespace. The urn:ejb-pool namespace elements can be used to configure pool
  • Pool
    A pool of stateless objects. A pool is linked to an object factory. How this link is established is
  • StatelessObjectFactory
    Creates and destroys stateless objects. The object returned by create has dependencies injected. The
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now