Skip to content

Commit

Permalink
squid:S1161 - '@OverRide' annotation should be used on any method ove…
Browse files Browse the repository at this point in the history
…rriding (since Java 5) or implementing (since Java 6) another one (kiegroup#518)
  • Loading branch information
George Kankava authored and mswiderski committed Jul 2, 2016
1 parent 07822e8 commit cd3bf0e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public void setKnowledgeRuntime(InternalKnowledgeRuntime kruntime) {
this.kruntime = kruntime;
}

@Override
public void addProcessInstance(ProcessInstance processInstance, CorrelationKey correlationKey) {
ProcessInstanceInfo processInstanceInfo = new ProcessInstanceInfo( processInstance, this.kruntime.getEnvironment() );
ProcessPersistenceContext context
Expand All @@ -82,7 +83,8 @@ public void addProcessInstance(ProcessInstance processInstance, CorrelationKey c
}
internalAddProcessInstance(processInstance);
}


@Override
public void internalAddProcessInstance(ProcessInstance processInstance) {
if( processInstances.putIfAbsent(processInstance.getId(), processInstance) != null ) {
throw new ConcurrentModificationException(
Expand All @@ -91,10 +93,12 @@ public void internalAddProcessInstance(ProcessInstance processInstance) {
}
}

@Override
public ProcessInstance getProcessInstance(long id) {
return getProcessInstance(id, false);
}

@Override
public ProcessInstance getProcessInstance(long id, boolean readOnly) {
InternalRuntimeManager manager = (InternalRuntimeManager) kruntime.getEnvironment().get("RuntimeManager");
if (manager != null) {
Expand Down Expand Up @@ -148,10 +152,12 @@ public ProcessInstance getProcessInstance(long id, boolean readOnly) {
return processInstance;
}

@Override
public Collection<ProcessInstance> getProcessInstances() {
return Collections.unmodifiableCollection(processInstances.values());
}

@Override
public void removeProcessInstance(ProcessInstance processInstance) {
ProcessPersistenceContext context = ((ProcessPersistenceContextManager) this.kruntime.getEnvironment().get( EnvironmentName.PERSISTENCE_CONTEXT_MANAGER )).getProcessPersistenceContext();
ProcessInstanceInfo processInstanceInfo = context.findProcessInstanceInfo( processInstance.getId() );
Expand All @@ -162,16 +168,19 @@ public void removeProcessInstance(ProcessInstance processInstance) {
internalRemoveProcessInstance(processInstance);
}

@Override
public void internalRemoveProcessInstance(ProcessInstance processInstance) {
processInstances.remove( processInstance.getId() );
}


@Override
public void clearProcessInstances() {
/*for (ProcessInstance processInstance: new ArrayList<ProcessInstance>(processInstances.values())) {
((ProcessInstanceImpl) processInstance).disconnect();
}*/
}

@Override
public void clearProcessInstancesState() {
try {
// at this point only timers are considered as state that needs to be cleared
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

public class InfinispanProcessInstanceManagerFactory implements ProcessInstanceManagerFactory {

@Override
public ProcessInstanceManager createProcessInstanceManager(InternalKnowledgeRuntime kruntime) {
InfinispanProcessInstanceManager result = new InfinispanProcessInstanceManager();
result.setKnowledgeRuntime(kruntime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public class InfinispanSignalManager extends DefaultSignalManager {
public InfinispanSignalManager(InternalKnowledgeRuntime kruntime) {
super(kruntime);
}


@Override
public void signalEvent(String type,
Object event) {
for ( long id : getProcessInstancesForEvent( type ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

public class InfinispanSignalManagerFactory implements SignalManagerFactory {

@Override
public SignalManager createSignalManager(InternalKnowledgeRuntime kruntime) {
return new InfinispanSignalManager(kruntime);
}
Expand Down

0 comments on commit cd3bf0e

Please sign in to comment.