use of javax.annotation.PostConstruct in project javaee7-samples by javaee-samples.
the class SubscriptionCreator method createSubscription.
/**
* We create the subscription at soonest possible time after deployment so we
* wouldn't miss any message
*/
@PostConstruct
void createSubscription() {
try (JMSContext jms = factory.createContext()) {
// <1> This is factory with clientId specified
// <2> creates durable subscription on the topic
JMSConsumer consumer = jms.createDurableConsumer(topic, Resources.SUBSCRIPTION);
consumer.close();
}
}
use of javax.annotation.PostConstruct in project wildfly by wildfly.
the class StatefulBeanA method onConstruct.
@PostConstruct
void onConstruct() throws Exception {
final Properties jndiProps = this.getInitialContextProperties();
final Context context = new InitialContext(jndiProps);
// lookup and set the SFSB from remote server
this.statefulBeanOnOtherServer = (StatefulRemoteOnOtherServer) context.lookup("ejb:/deployment-on-other-server//StatefulBeanOnOtherServer!" + StatefulRemoteOnOtherServer.class.getName() + "?stateful");
// lookup and set the SLSB from remote server
this.statelessRemoteOnOtherServer = (StatelessRemoteOnOtherServer) context.lookup("ejb:/deployment-on-other-server//StatelessBeanOnOtherServer!" + StatelessRemoteOnOtherServer.class.getName());
// EJB 2.x remote home view of bean on other server
this.statefulRemoteHomeForBeanOnOtherServer = (StatefulRemoteHomeForBeanOnOtherServer) context.lookup("ejb:/deployment-on-other-server//StatefulBeanOnOtherServer!" + StatefulRemoteHomeForBeanOnOtherServer.class.getName());
}
use of javax.annotation.PostConstruct in project uPortal by Jasig.
the class PortalDataTypeTargetProviderImpl method init.
@PostConstruct
public void init() {
Iterable<IPortalDataType> dataTypes = portalDataHandlerService.getExportPortalDataTypes();
for (IPortalDataType type : dataTypes) {
final String typeId = type.getTypeId();
targetMap.put(typeId, new PermissionTargetImpl(typeId, typeId, IPermissionTarget.TargetType.DATA_TYPE));
}
}
use of javax.annotation.PostConstruct in project midpoint by Evolveum.
the class OrgClosureManager method initialize.
@PostConstruct
public void initialize() {
OperationResult result = new OperationResult(OrgClosureManager.class.getName() + ".initialize");
if (!isEnabled()) {
return;
}
SqlRepositoryConfiguration repoConfiguration = baseHelper.getConfiguration();
if (isOracle()) {
initializeOracleTemporaryTable();
}
if (autoUpdateClosureTableStructure()) {
// need to rebuild the content of the closure table after re-creating it anew
checkAndOrRebuild(false, true, repoConfiguration.isStopOnOrgClosureStartupFailure(), true, result);
} else {
boolean check, rebuild;
switch(repoConfiguration.getOrgClosureStartupAction()) {
case NONE:
return;
case CHECK:
check = true;
rebuild = false;
break;
case REBUILD_IF_NEEDED:
check = true;
rebuild = true;
break;
case ALWAYS_REBUILD:
check = false;
rebuild = true;
break;
default:
throw new IllegalArgumentException("Invalid value: " + repoConfiguration.getOrgClosureStartupAction());
}
checkAndOrRebuild(check, rebuild, repoConfiguration.isStopOnOrgClosureStartupFailure(), true, result);
}
}
use of javax.annotation.PostConstruct in project jetcache by alibaba.
the class CacheContext method init.
@PostConstruct
public synchronized void init() {
if (cacheManager == null) {
this.cacheManager = new CacheManager();
if (globalCacheConfig.getStatIntervalMinutes() > 0) {
defaultCacheMonitorManager = new DefaultCacheMonitorManager(globalCacheConfig.getStatIntervalMinutes(), TimeUnit.MINUTES, globalCacheConfig.getConfigProvider().statCallback());
defaultCacheMonitorManager.start();
}
}
}
Aggregations