Skip to content

Commit

Permalink
Eagerly create MDBs on startup
Browse files Browse the repository at this point in the history
The CDI TCK requires events for MDBs to be fired on startup. The easiest
way to satisfy that requirement is to eagerly load MDBs by default.
Users can still disable that if needed.

First commit is some refactoring, mostly formatting and some naming.
Second commmit will be the actual change.

Signed-off-by: Arjan Tijms <arjan.tijms@gmail.com>
  • Loading branch information
arjantijms committed Jun 7, 2022
1 parent 0c63273 commit a4bb40e
Show file tree
Hide file tree
Showing 11 changed files with 920 additions and 1,190 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2022, 2022 Contributors to the Eclipse Foundation.
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand All @@ -16,123 +17,106 @@

package org.glassfish.ejb.config;

import org.jvnet.hk2.config.Attribute;
import org.jvnet.hk2.config.Element;
import org.jvnet.hk2.config.Configured;
import org.jvnet.hk2.config.ConfigBeanProxy;
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;

import java.beans.PropertyVetoException;
import java.util.List;

import org.glassfish.config.support.datatypes.NonNegativeInteger;
import org.glassfish.api.admin.config.ConfigExtension;
import org.glassfish.api.admin.config.PropertiesDesc;
import org.glassfish.api.admin.config.PropertyDesc;
import org.glassfish.config.support.datatypes.NonNegativeInteger;
import org.jvnet.hk2.config.Attribute;
import org.jvnet.hk2.config.ConfigBeanProxy;
import org.jvnet.hk2.config.Configured;
import org.jvnet.hk2.config.Element;
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;

import jakarta.validation.constraints.Min;

/* @XmlType(name = "", propOrder = {
"property"
}) */

@Configured
public interface MdbContainer extends ConfigBeanProxy, PropertyBag, ConfigExtension {


/**
* Gets the value of the steadyPoolSize property.
* Minimum and initial number of message driven beans in pool.
* An integer in the range [0, max-pool-size].
* Gets the value of the steadyPoolSize property. Minimum and initial number of message driven beans in pool. An integer
* in the range [0, max-pool-size].
*
* @return possible object is
* {@link String }
* @return possible object is {@link String }
*/
@Attribute (defaultValue="0")
@Min(value=0)
@Attribute(defaultValue = "0")
@Min(value = 0)
String getSteadyPoolSize();

/**
* Sets the value of the steadyPoolSize property.
*
* @param value allowed object is
* {@link String }
* @param value allowed object is {@link String }
*/
void setSteadyPoolSize(String value) throws PropertyVetoException;

/**
* Gets the value of the poolResizeQuantity property.
*
* Quantum of increase/decrease, when the size of pool grows/shrinks.
* An integer in the range [0, max-pool-size].
* Quantum of increase/decrease, when the size of pool grows/shrinks. An integer in the range [0, max-pool-size].
*
* @return possible object is
* {@link String }
* @return possible object is {@link String }
*/
@Attribute (defaultValue="8")
@Min(value=0)
@Attribute(defaultValue = "8")
@Min(value = 0)
String getPoolResizeQuantity();

/**
* Sets the value of the poolResizeQuantity property.
*
* @param value allowed object is
* {@link String }
* @param value allowed object is {@link String }
*/
void setPoolResizeQuantity(String value) throws PropertyVetoException;

/**
* Gets the value of the maxPoolSize property.
* maximum size, pool can grow to. A non-negative integer.
* Gets the value of the maxPoolSize property. maximum size, pool can grow to. A non-negative integer.
*
* @return possible object is
* {@link String }
* @return possible object is {@link String }
*/
@Attribute (defaultValue="32")
@Min(value=0)
@Attribute(defaultValue = "32")
@Min(value = 0)
String getMaxPoolSize();

/**
* Sets the value of the maxPoolSize property.
*
* @param value allowed object is
* {@link String }
* @param value allowed object is {@link String }
*/
void setMaxPoolSize(String value) throws PropertyVetoException;

/**
* Gets the value of the idleTimeoutInSeconds property.
*
* Idle bean instance in pool becomes a candidate for deletion, when this
* timeout expires
* Idle bean instance in pool becomes a candidate for deletion, when this timeout expires
*
* @return possible object is
* {@link String }
* @return possible object is {@link String }
*/
@Attribute (defaultValue="600")
@Min(value=0)
@Attribute(defaultValue = "600")
@Min(value = 0)
String getIdleTimeoutInSeconds();

/**
* Sets the value of the idleTimeoutInSeconds property.
*
* @param value allowed object is
* {@link String }
* @param value allowed object is {@link String }
*/
void setIdleTimeoutInSeconds(String value) throws PropertyVetoException;


/**
Properties.
* Properties.
*/
@PropertiesDesc(
props={
@PropertyDesc(name="cmt-max-runtime-exceptions", defaultValue="1", dataType=NonNegativeInteger.class,
description="Deprecated. Specifies the maximum number of RuntimeException occurrences allowed from a message-driven bean's " +
"method when container-managed transactions are used")
}
)
@Override
@PropertiesDesc(props = {
@PropertyDesc(
name = "cmt-max-runtime-exceptions",
defaultValue = "1",
dataType = NonNegativeInteger.class,
description =
"Deprecated. Specifies the maximum number of RuntimeException occurrences allowed from a message-driven bean's " +
"method when container-managed transactions are used") })
@Element
List<Property> getProperty();
}

0 comments on commit a4bb40e

Please sign in to comment.