UuidJobHandle jobhandle = new UuidJobHandle();
// Get the Service Configuration from the Data field
SchedulerServiceConfiguration conf = (SchedulerServiceConfiguration) schedulerGsd.getData();
// If the GSD doesn't have conf and it doesn't have addresses, we can use the local SchedulerService
if ( conf == null && schedulerGsd.getAddresses().get( "socket" ) == null ) {
SchedulerService sched = null;
try {
// We use the ID that contains the type of the service that we are using -> refactor this and include serviceType in GSD
sched = grid.get( (Class<SchedulerService>) Class.forName( schedulerGsd.getServiceInterface().getCanonicalName() ) );
} catch ( ClassNotFoundException ex ) {
Logger.getLogger( SchedulerClient.class.getName() ).log( Level.SEVERE,
null,
ex );
}
return sched.scheduleJob( job,
ctx,
trigger );
}
// If we have a service configuration
int redundancy = 1;