本文整理了Java中javax.ejb.Startup.<init>()
方法的一些代码示例,展示了Startup.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Startup.<init>()
方法的具体详情如下:
包路径:javax.ejb.Startup
类名称:Startup
方法名:<init>
暂无
代码示例来源:origin: javaee-samples/javaee7-samples
/**
* @author arungupta
*/
@Startup
@Singleton
public class MyTimerScheduleBean extends AbstractTimerBatch {
}
代码示例来源:origin: javaee-samples/javaee7-samples
@Startup
@Singleton
public class PingsListener {
final List<Ping> pings = new CopyOnWriteArrayList<>();
public void listen(@Observes Ping ping) {
System.out.println("ping = " + ping);
pings.add(ping);
}
public List<Ping> getPings() {
return pings;
}
}
代码示例来源:origin: javaee-samples/javaee7-samples
/**
* @author Jacek Jackowiak
*/
@Startup
@Singleton
public class SchedulesTimerBean {
@Inject
Event<Ping> pingEvent;
@Schedules({
@Schedule(hour = "*", minute = "*", second = "*/5", info = "Every 5 second timer"),
@Schedule(hour = "*", minute = "*", second = "*/10", info = "Every 10 second timer")
})
public void automaticallyScheduled(Timer timer) {
pingEvent.fire(new Ping(timer.getInfo().toString()));
}
}
代码示例来源:origin: javaee-samples/javaee7-samples
/**
* @author Arun Gupta
*/
@Startup
@Singleton
public class AutomaticTimerBean {
@Resource
SessionContext ctx;
@Inject
Event<Ping> pingEvent;
@Schedule(hour = "*", minute = "*", second = "*/5", info = "Every 5 second timer")
public void printDate() {
Collection<Timer> timers = ctx.getTimerService().getAllTimers();
for (Timer t : timers) {
pingEvent.fire(new Ping(t.getInfo().toString()));
}
}
}
代码示例来源:origin: javaee-samples/javaee7-samples
/**
* @author Jacek Jackowiak
*/
@Startup
@Singleton
public class MultipleScheduleTimerBean {
@Inject
Event<Ping> pingEvent;
@Schedule(hour = "*", minute = "*", second = "*/5", info = "Every 5 second timer")
public void fastAutomaticallyScheduled(Timer timer) {
fireEvent(timer);
}
@Schedule(hour = "*", minute = "*", second = "*/10", info = "Every 10 second timer")
public void slowlyAutomaticallyScheduled(Timer timer) {
fireEvent(timer);
}
private void fireEvent(Timer timer) {
pingEvent.fire(new Ping(timer.getInfo().toString()));
}
}
代码示例来源:origin: javaee-samples/javaee7-samples
/**
* @author Arun Gupta
*/
@Startup
@Singleton
public class MySingletonBeanManagedConcurrency {
volatile StringBuilder builder;
@PostConstruct
private void postConstruct() {
builder = new StringBuilder();
System.out.println("postConstruct");
}
public String readSomething() {
return "current timestamp: " + new Date();
}
public String writeSomething(String something) {
synchronized (builder) {
builder.append(something);
}
return builder.toString() + " : " + new Date();
}
}
代码示例来源:origin: javaee-samples/javaee7-samples
/**
* @author Arun Gupta
*/
@Startup
@Singleton
public class MySingleton {
StringBuilder builder;
@PostConstruct
private void postConstruct() {
System.out.println("postConstruct");
builder = new StringBuilder();
}
@Lock(LockType.READ)
public String readSomething() {
return "current timestamp: " + new Date();
}
@Lock(LockType.WRITE)
public String writeSomething(String something) {
builder.append(something);
return builder.toString() + " : " + new Date();
}
}
代码示例来源:origin: javaee-samples/javaee7-samples
@Startup
@Singleton
public class ProgrammaticTimerBean {
代码示例来源:origin: javaee-samples/javaee7-samples
@Singleton
@Startup
public class BeanRoot implements BeanRootInterface {
代码示例来源:origin: camunda/camunda-bpm-platform
@Startup
@Singleton(name="BpmPlatformBootstrap")
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
代码示例来源:origin: camunda/camunda-bpm-platform
@Startup
@ConcurrencyManagement(ConcurrencyManagementType.BEAN)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
代码示例来源:origin: com.caucho/resin
/**
* Top-level JMS connection
*/
@Singleton
@Startup
public class JmsConnectionFactory
extends com.caucho.jms.connection.ConnectionFactoryImpl
{
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* @author Tassilo Weidner
*/
@Singleton
@Startup
@ConcurrencyManagement(ConcurrencyManagementType.BEAN)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
@ProcessApplication(deploymentDescriptors = {"deployment-descriptor-with-custom-filename.xml"})
@Local(ProcessApplicationInterface.class)
public class AnnotatedEjbPa extends EjbProcessApplication {
@PostConstruct
public void start() {
deploy();
}
@PreDestroy
public void stop() {
undeploy();
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Custom {@link EjbProcessApplication} with PA lifecycle callbacks
*
* @author Daniel Meyer
*
*/
@Singleton
@Startup
@ConcurrencyManagement(ConcurrencyManagementType.BEAN)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
@ProcessApplication
@Local(ProcessApplicationInterface.class)
public class CustomEjbProcessApplication extends EjbProcessApplication {
@PostDeploy
public void postDeploy(ProcessEngine processEngine) {
Assert.assertNotNull(processEngine);
}
@PreUndeploy
public void preUnDeploy(ProcessEngine processEngine) {
Assert.assertNotNull(processEngine);
}
}
代码示例来源:origin: com.blazebit/blaze-storage-core-config-wildfly
@Startup
@Singleton
public class InitializerSingleton {
private static final Logger LOG = Logger.getLogger(InitializerSingleton.class.getName());
@PostConstruct
public void init() {
// TODO: warm up REST endpoints
// Initialize some rest resources
// Client client = ClientBuilder.newClient();
}
}
代码示例来源:origin: payara/Payara-Examples
/**
*
* @author steve
*/
@Singleton
@Startup
public class SimpleTimerBean {
static Logger logger = Logger.getLogger(SimpleTimerBean.class.getCanonicalName());
@Schedule(hour = "*", minute = "*", second = "*/5", info = "Every 5 second timer", timezone = "UTC")
public void printSchedule() {
logger.info("SimpleTimerBean Schedule Fired .... ");
}
}
代码示例来源:origin: moelholm/smallexamples
@Startup
@Singleton
public class AnotherBusinessServiceBean {
private final static Logger logger = LoggerFactory.getLogger(AnotherBusinessServiceBean.class);
@PostConstruct
public void postConstruct() {
logger.info("Created in classloader = [{}]", getClass().getClassLoader());
}
public String sayHello(String caller) {
logger.info("Sending greeting to {} // classloader = [{}]", caller, getClass().getClassLoader());
return String.format("Hello %s", caller);
}
}
代码示例来源:origin: akquinet/jbosscc-as7-examples
@Singleton
@Startup
public class ApplicationBootstrap {
@Inject
private Logger log;
@EJB
private UserTestdata userTestdata;
@PostConstruct
public void insertTestdata() {
log.info("insert testdata");
userTestdata.insert();
}
}
代码示例来源:origin: moelholm/smallexamples
@Startup
@Singleton
public class BusinessServiceBean {
private final static Logger logger = LoggerFactory.getLogger(BusinessServiceBean.class);
@EJB//(lookup = "java:global/myapp/myejbmodule/AnotherBusinessServiceBean")
private AnotherBusinessServiceBean anotherBusinessServiceBean;
@PostConstruct
public void postConstruct() {
logger.info("Created in classloader = [{}]", getClass().getClassLoader());
logger.info("Initial greeting is: {}", anotherBusinessServiceBean.sayHello(getClass().getSimpleName()));
}
public String sayHello(String caller) {
return anotherBusinessServiceBean.sayHello(caller);
}
}
代码示例来源:origin: com.charlyghislain.authenticator/authenticator-ejb
@Singleton
@Startup
public class AuthApplicationInitialization {
@EJB
private LiquibaseChangelogRunner liquibaseChangelogRunner;
@EJB
private DefaultResourcesService defaultResourcesService;
@PostConstruct
public void init() {
liquibaseChangelogRunner.runChangeLogs();
defaultResourcesService.createDefaultResources();
}
}
内容来源于网络,如有侵权,请联系作者删除!