@Override public void set( Object associated ) throws IllegalArgumentException { next.set( associated ); }
private Schedule newTransientOnceSchedule( Task task, DateTime runAt ) { ValueBuilder<OnceSchedule> builder = module.newValueBuilder( OnceSchedule.class ); OnceSchedule builderInstance = builder.prototype(); builderInstance.task().set( task ); builderInstance.start().set( runAt ); builderInstance.identity().set( uuid.generate( CronSchedule.class ) ); OnceSchedule schedule = builder.newInstance(); logger.info( "Schedule {} created: {}", schedule.presentationString(), schedule.identity().get() ); return schedule; }
private CronSchedule newTransientCronSchedule( Task task, String cronExpression, DateTime start ) { ValueBuilder<CronSchedule> builder = module.newValueBuilder( CronSchedule.class ); CronSchedule prototype = builder.prototype(); prototype.task().set( task ); prototype.start().set( start ); prototype.identity().set( uuid.generate( CronSchedule.class ) ); prototype.cronExpression().set( cronExpression ); CronSchedule schedule = builder.newInstance(); logger.info( "Schedule {} created: {}", schedule.presentationString(), schedule.identity().get() ); return schedule; }
private Schedule newPersistentOnceSchedule( Task task, DateTime runAt ) { UnitOfWork uow = module.currentUnitOfWork(); EntityBuilder<OnceSchedule> builder = uow.newEntityBuilder( OnceSchedule.class ); OnceSchedule builderInstance = builder.instance(); builderInstance.task().set( task ); builderInstance.start().set( runAt ); builderInstance.identity().set( uuid.generate( CronSchedule.class ) ); OnceSchedule schedule = builder.newInstance(); logger.info( "Schedule {} created: {}", schedule.presentationString(), schedule.identity().get() ); return schedule; } }
private CronSchedule newPersistentCronSchedule( Task task, String cronExpression, DateTime start ) { UnitOfWork uow = module.currentUnitOfWork(); EntityBuilder<CronSchedule> builder = uow.newEntityBuilder( CronSchedule.class ); CronSchedule builderInstance = builder.instance(); builderInstance.task().set( task ); builderInstance.start().set( start ); builderInstance.identity().set( uuid.generate( CronSchedule.class ) ); builderInstance.cronExpression().set( cronExpression ); CronSchedule schedule = builder.newInstance(); logger.info( "Schedule {} created: {}", schedule.presentationString(), schedule.identity().get() ); return schedule; }
EntityTraceRecordEntity state = builder.instance(); setStandardStuff( compositeType, method, args, entryTime, durationNano, state, exception ); state.source().set( source );
instance.localDateTimeValue().set( new LocalDateTime( "2020-03-04T13:23:00" ) ); instance.localDateValue().set( new LocalDate( "2020-03-04" ) ); instance.association().set( instance );
proto.barAssociation().set( buildBarEntity( "bazar in barAssociation" ) ); proto.barEntityAssociation().set( buildBarEntity( "bazar in barEntityAssociation" ) ); proto.barManyAssociation().add( buildBarEntity( "bazar ONE in barManyAssociation" ) ); proto.barManyAssociation().add( buildBarEntity( "bazar TWO in barManyAssociation" ) );
private void createLogRecord( UnitOfWork uow, LogType type, Composite composite, String category, String message, List<Serializable> params ) { if( composite instanceof ServiceComposite ) { EntityBuilder<ServiceLogRecord> builder = uow.newEntityBuilder( ServiceLogRecord.class ); ServiceLogRecord state = builder.instance(); setStandardStuff( type, composite, category, message, state, params ); state.source().set( ( (ServiceComposite) composite ).identity().get() ); ServiceLogRecord slr = builder.newInstance(); } else if( composite instanceof EntityComposite ) { EntityBuilder<EntityLogRecord> builder = uow.newEntityBuilder( EntityLogRecord.class ); EntityLogRecord state = builder.instance(); setStandardStuff( type, composite, category, message, state, params ); state.source().set( (EntityComposite) composite ); EntityLogRecord elr = builder.newInstance(); } else { EntityBuilder<CompositeLogRecord> builder = uow.newEntityBuilder( CompositeLogRecord.class ); CompositeLogRecord state = builder.instance(); setStandardStuff( type, composite, category, message, state, params ); state.source().set( composite ); CompositeLogRecord clr = builder.newInstance(); } }
private void createDebugRecord( UnitOfWork uow, Composite composite, String message, List<Serializable> params ) { if( composite instanceof ServiceComposite ) { EntityBuilder<ServiceDebugRecordEntity> builder = uow.newEntityBuilder( ServiceDebugRecordEntity.class ); ServiceDebugRecordEntity state = builder.instance(); setStandardStuff( composite, message, state, params ); state.source().set( ( (ServiceComposite) composite ).identity().get() ); ServiceDebugRecordEntity slr = builder.newInstance(); } else if( composite instanceof EntityComposite ) { EntityBuilder<EntityDebugRecordEntity> builder = uow.newEntityBuilder( EntityDebugRecordEntity.class ); EntityDebugRecordEntity state = builder.instance(); setStandardStuff( composite, message, state, params ); state.source().set( (EntityComposite) composite ); EntityDebugRecordEntity elr = builder.newInstance(); } else { EntityBuilder<CompositeDebugRecordEntity> builder = uow.newEntityBuilder( CompositeDebugRecordEntity.class ); CompositeDebugRecordEntity state = builder.instance(); setStandardStuff( composite, message, state, params ); state.source().set( composite ); CompositeDebugRecordEntity clr = builder.newInstance(); } }
annDoe.name().set( "Ann Doe" ); annDoe.title().set( Person.Title.MRS ); annDoe.placeOfBirth().set( kualaLumpur ); annDoe.yearOfBirth().set( 1975 ); annDoe.interests().add( 0, cooking ); annDoe.password().set( "passwordOfAnnDoe" ); annDoe.mainAccount().set( annsAccount ); annDoe.accounts().put( "anns", annsAccount ); annDoe.accounts().put( "jacks", jacksAccount ); joeDoe.name().set( "Joe Doe" ); joeDoe.title().set( Person.Title.MR ); joeDoe.placeOfBirth().set( kualaLumpur ); joeDoe.yearOfBirth().set( 1990 ); joeDoe.mother().set( annDoe ); joeDoe.interests().add( 0, programming ); joeDoe.interests().add( 0, gaming ); jackDoe.name().set( "Jack Doe" ); jackDoe.title().set( Person.Title.DR ); jackDoe.placeOfBirth().set( penang ); jackDoe.yearOfBirth().set( 1970 ); jackDoe.interests().add( 0, cars ); jackDoe.wife().set( annDoe ); jackDoe.password().set( "passwordOfJohnDoe" ); jackDoe.mainAccount().set( jacksAccount ); jackDoe.accounts().put( "anns", annsAccount ); jackDoe.accounts().put( "jacks", jacksAccount );