use of javax.annotation.PostConstruct in project pinpoint by naver.
the class TestUDPReceiver method start.
@PostConstruct
@Override
public void start() {
logger.info("{} start.", receiverName);
afterPropertiesSet();
final DatagramSocket socket = this.socket;
if (socket == null) {
throw new IllegalStateException("socket is null.");
}
bindSocket(socket, bindAddress, port);
logger.info("UDP Packet reader:{} started.", ioThreadSize);
for (int i = 0; i < ioThreadSize; i++) {
io.execute(new Runnable() {
@Override
public void run() {
receive(socket);
}
});
}
}
use of javax.annotation.PostConstruct in project che by eclipse.
the class WSocketEventBusClient method start.
@PostConstruct
void start() {
if (start.compareAndSet(false, true)) {
if (policy != null) {
eventService.subscribe(new EventSubscriber<Object>() {
@Override
public void onEvent(Object event) {
propagate(event);
}
});
}
if (eventSubscriptions != null) {
final Map<URI, Set<String>> cfg = new HashMap<>();
for (Pair<String, String> service : eventSubscriptions) {
try {
final URI key = new URI(service.first);
Set<String> values = cfg.get(key);
if (values == null) {
cfg.put(key, values = new LinkedHashSet<>());
}
if (service.second != null) {
values.add(service.second);
}
} catch (URISyntaxException e) {
LOG.error(e.getMessage(), e);
}
}
if (!cfg.isEmpty()) {
executor = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("WSocketEventBusClient-%d").setUncaughtExceptionHandler(LoggingUncaughtExceptionHandler.getInstance()).setDaemon(true).build());
for (Map.Entry<URI, Set<String>> entry : cfg.entrySet()) {
executor.execute(new ConnectTask(entry.getKey(), entry.getValue()));
}
}
}
}
}
use of javax.annotation.PostConstruct in project che by eclipse.
the class JavaPlugin method start.
@PostConstruct
public void start() {
// WorkingCopyOwner.setPrimaryBufferProvider(new WorkingCopyOwner() {
// @Override
// public IBuffer createBuffer(ICompilationUnit workingCopy) {
// ICompilationUnit original = workingCopy.getPrimary();
// IResource resource = original.getResource();
// if (resource instanceof IFile)
// return new DocumentAdapter(workingCopy, (IFile)resource);
// return DocumentAdapter.NULL;
// }
// });
new JavaCore();
fMembersOrderPreferenceCache = new MembersOrderPreferenceCache();
PreferenceConstants.initializeDefaultValues(PreferenceConstants.getPreferenceStore());
new JavaCorePreferenceInitializer().initializeDefaultPreferences();
new CheCodeFormatterInitializer().initializeDefaultPreferences();
}
use of javax.annotation.PostConstruct in project vaadin-samples by xpoft.
the class AuthenticatedView method PostConstruct.
@PostConstruct
public void PostConstruct() {
setSizeFull();
VerticalLayout layout = new VerticalLayout();
layout.setSpacing(true);
layout.setMargin(true);
layout.addComponent(new Label("@RequiresAuthentication"));
layout.addComponent(new Link("Go back", new ExternalResource("#!" + MainView.NAME)));
setContent(layout);
}
use of javax.annotation.PostConstruct in project vaadin-samples by xpoft.
the class MainView method PostConstruct.
//private Label rolesLabel = new Label();
@PostConstruct
public void PostConstruct() {
setSizeFull();
VerticalLayout layout = new VerticalLayout();
layout.setSpacing(true);
layout.setMargin(true);
HorizontalLayout usernameLayout = new HorizontalLayout();
usernameLayout.setSpacing(true);
usernameLayout.addComponent(new Label("Username:"));
usernameLayout.addComponent(usernameLabel);
//HorizontalLayout userRolesLayout = new HorizontalLayout();
//userRolesLayout.setSpacing(true);
//userRolesLayout.addComponent(new Label("Roles:"));
//userRolesLayout.addComponent(rolesLabel);
layout.addComponent(usernameLayout);
//addComponent(userRolesLayout);
Link roleUserView = new Link("Role \"user\" View (disabled, if user doesn't have access)", new ExternalResource("#!" + RoleUserView.NAME));
Link roleAdminView = new Link("Role \"admin\" View (disabled, if user doesn't have access)", new ExternalResource("#!" + RoleAdminView.NAME));
Link authenticatedView = new Link("@RequiresAuthentication View (disabled, if user doesn't have access)", new ExternalResource("#!" + AuthenticatedView.NAME));
Link guestView = new Link("@RequiresGuest View (disabled, if user doesn't have access)", new ExternalResource("#!" + GuestView.NAME));
Link userView = new Link("@RequiresUser View (disabled, if user doesn't have access)", new ExternalResource("#!" + UserView.NAME));
roleUserView.setEnabled(ShiroSecurityNavigator.hasAccess(RoleUserView.class));
roleAdminView.setEnabled(ShiroSecurityNavigator.hasAccess(RoleAdminView.class));
authenticatedView.setEnabled(ShiroSecurityNavigator.hasAccess(AuthenticatedView.class));
guestView.setEnabled(ShiroSecurityNavigator.hasAccess(GuestView.class));
userView.setEnabled(ShiroSecurityNavigator.hasAccess(UserView.class));
layout.addComponent(roleUserView);
layout.addComponent(roleAdminView);
layout.addComponent(authenticatedView);
layout.addComponent(guestView);
layout.addComponent(userView);
layout.addComponent(new Link("Role \"admin\" View (throw exception, if user doesn't have access)", new ExternalResource("#!" + RoleAdminView.NAME)));
layout.addComponent(new Link("Logout", new ExternalResource("/logout/")));
setContent(layout);
}
Aggregations