String owner = CarbonContext.getCurrentContext().getUsername();
if(owner != null && owner.length() > 0){
bucket.setOwner(owner);
}
CEPBackEndRuntimeFactory cepBackEndRuntimeFactory =
(CEPBackEndRuntimeFactory) cepEngineProvider.getProviderClass().newInstance();
List<Mapping> inputMappings = new ArrayList();
if (bucket.getInputs() != null) {
for (Input input : bucket.getInputs()) {
inputMappings.add(input.getMapping());
}
}
CEPBackEndRuntime cepBackEndRuntime =
cepBackEndRuntimeFactory.createCEPBackEndRuntime(bucket.getName(), inputMappings, tenantId);
CEPBucket cepBucket = new CEPBucket(cepBackEndRuntime, bucket, axisConfiguration);
cepBucket.init();
CEPRegistryInvoker.addBucketsToRegistry(bucket, tenantId);