use of org.osgi.service.component.annotations.Activate in project karaf by apache.
the class RestService method activate.
@Activate
public void activate() throws Exception {
JAXRSServerFactoryBean bean = new JAXRSServerFactoryBean();
bean.setAddress("/booking");
bean.setBus(BusFactory.getDefaultBus());
bean.setProvider(new JacksonJsonProvider());
bean.setServiceBean(new BookingServiceRest());
server = bean.create();
}
use of org.osgi.service.component.annotations.Activate in project karaf by apache.
the class ConsoleClient method start.
@Activate
public void start() throws Exception {
Booking booking = new Booking();
booking.setId(1L);
booking.setFlight("AF520");
booking.setCustomer("John Doe");
bookingService.add(booking);
booking = new Booking();
booking.setId(2L);
booking.setFlight("AF59");
booking.setCustomer("Alan Parker");
bookingService.add(booking);
running = true;
Thread thread = new Thread(() -> {
while (running) {
try {
Thread.sleep(5000);
for (Booking booking1 : bookingService.list()) {
System.out.println();
System.out.println("-----------");
System.out.println(booking1.getId() + " - " + booking1.getFlight() + " - " + booking1.getCustomer());
}
} catch (Exception e) {
// nothing to do
}
}
});
thread.start();
}
use of org.osgi.service.component.annotations.Activate in project liferay-blade-samples by liferay.
the class AddTestData method addTestData.
@Activate
public void addTestData() {
Foo foo = FooLocalServiceUtil.createFoo(0);
foo.setField1("createFooEntryField1");
foo.setField2(true);
foo.setField3(1);
foo.setField4(new Date());
foo.setField5("createFooEntryField5");
foo.isNew();
Foo fooEntry = FooLocalServiceUtil.addFoo(foo);
if (!fooEntry.getField2()) {
_log.error("Test Failed");
}
FooLocalServiceUtil.deleteFoo(fooEntry);
}
use of org.osgi.service.component.annotations.Activate in project liferay-blade-samples by liferay.
the class QuxPersistenceImpl method activate.
/**
* Initializes the qux persistence.
*/
@Activate
public void activate() {
QuxModelImpl.setEntityCacheEnabled(entityCacheEnabled);
QuxModelImpl.setFinderCacheEnabled(finderCacheEnabled);
_finderPathWithPaginationFindAll = new FinderPath(entityCacheEnabled, finderCacheEnabled, QuxImpl.class, FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
_finderPathWithoutPaginationFindAll = new FinderPath(entityCacheEnabled, finderCacheEnabled, QuxImpl.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
_finderPathCountAll = new FinderPath(entityCacheEnabled, finderCacheEnabled, Long.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
_finderPathWithPaginationFindByUuid = new FinderPath(entityCacheEnabled, finderCacheEnabled, QuxImpl.class, FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByUuid", new String[] { String.class.getName(), Integer.class.getName(), Integer.class.getName(), OrderByComparator.class.getName() });
_finderPathWithoutPaginationFindByUuid = new FinderPath(entityCacheEnabled, finderCacheEnabled, QuxImpl.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByUuid", new String[] { String.class.getName() }, QuxModelImpl.UUID_COLUMN_BITMASK);
_finderPathCountByUuid = new FinderPath(entityCacheEnabled, finderCacheEnabled, Long.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByUuid", new String[] { String.class.getName() });
_finderPathFetchByUUID_G = new FinderPath(entityCacheEnabled, finderCacheEnabled, QuxImpl.class, FINDER_CLASS_NAME_ENTITY, "fetchByUUID_G", new String[] { String.class.getName(), Long.class.getName() }, QuxModelImpl.UUID_COLUMN_BITMASK | QuxModelImpl.GROUPID_COLUMN_BITMASK);
_finderPathCountByUUID_G = new FinderPath(entityCacheEnabled, finderCacheEnabled, Long.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByUUID_G", new String[] { String.class.getName(), Long.class.getName() });
_finderPathWithPaginationFindByUuid_C = new FinderPath(entityCacheEnabled, finderCacheEnabled, QuxImpl.class, FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByUuid_C", new String[] { String.class.getName(), Long.class.getName(), Integer.class.getName(), Integer.class.getName(), OrderByComparator.class.getName() });
_finderPathWithoutPaginationFindByUuid_C = new FinderPath(entityCacheEnabled, finderCacheEnabled, QuxImpl.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByUuid_C", new String[] { String.class.getName(), Long.class.getName() }, QuxModelImpl.UUID_COLUMN_BITMASK | QuxModelImpl.COMPANYID_COLUMN_BITMASK);
_finderPathCountByUuid_C = new FinderPath(entityCacheEnabled, finderCacheEnabled, Long.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByUuid_C", new String[] { String.class.getName(), Long.class.getName() });
}
use of org.osgi.service.component.annotations.Activate in project liferay-blade-samples by liferay.
the class BazPersistenceImpl method activate.
/**
* Initializes the baz persistence.
*/
@Activate
public void activate() {
BazModelImpl.setEntityCacheEnabled(entityCacheEnabled);
BazModelImpl.setFinderCacheEnabled(finderCacheEnabled);
_finderPathWithPaginationFindAll = new FinderPath(entityCacheEnabled, finderCacheEnabled, BazImpl.class, FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
_finderPathWithoutPaginationFindAll = new FinderPath(entityCacheEnabled, finderCacheEnabled, BazImpl.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
_finderPathCountAll = new FinderPath(entityCacheEnabled, finderCacheEnabled, Long.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
_finderPathWithPaginationFindByUuid = new FinderPath(entityCacheEnabled, finderCacheEnabled, BazImpl.class, FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByUuid", new String[] { String.class.getName(), Integer.class.getName(), Integer.class.getName(), OrderByComparator.class.getName() });
_finderPathWithoutPaginationFindByUuid = new FinderPath(entityCacheEnabled, finderCacheEnabled, BazImpl.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByUuid", new String[] { String.class.getName() }, BazModelImpl.UUID_COLUMN_BITMASK);
_finderPathCountByUuid = new FinderPath(entityCacheEnabled, finderCacheEnabled, Long.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByUuid", new String[] { String.class.getName() });
_finderPathFetchByUUID_G = new FinderPath(entityCacheEnabled, finderCacheEnabled, BazImpl.class, FINDER_CLASS_NAME_ENTITY, "fetchByUUID_G", new String[] { String.class.getName(), Long.class.getName() }, BazModelImpl.UUID_COLUMN_BITMASK | BazModelImpl.GROUPID_COLUMN_BITMASK);
_finderPathCountByUUID_G = new FinderPath(entityCacheEnabled, finderCacheEnabled, Long.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByUUID_G", new String[] { String.class.getName(), Long.class.getName() });
_finderPathWithPaginationFindByUuid_C = new FinderPath(entityCacheEnabled, finderCacheEnabled, BazImpl.class, FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByUuid_C", new String[] { String.class.getName(), Long.class.getName(), Integer.class.getName(), Integer.class.getName(), OrderByComparator.class.getName() });
_finderPathWithoutPaginationFindByUuid_C = new FinderPath(entityCacheEnabled, finderCacheEnabled, BazImpl.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByUuid_C", new String[] { String.class.getName(), Long.class.getName() }, BazModelImpl.UUID_COLUMN_BITMASK | BazModelImpl.COMPANYID_COLUMN_BITMASK);
_finderPathCountByUuid_C = new FinderPath(entityCacheEnabled, finderCacheEnabled, Long.class, FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByUuid_C", new String[] { String.class.getName(), Long.class.getName() });
}
Aggregations