Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DROOLS-1119] fix timers serialization #732

Merged
merged 1 commit into from
Apr 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface InternalKnowledgeRuntime extends KnowledgeRuntime {

InternalProcessRuntime getProcessRuntime();

void setId(Long id);
void setIdentifier(long id);

void setEndOperationListener(EndOperationListener listener);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public interface InternalWorkingMemory

InternalAgenda getAgenda();

int getId();
void setId(Long id);
long getIdentifier();
void setIdentifier(long id);

void setRuleRuntimeEventSupport(RuleRuntimeEventSupport workingMemoryEventSupport);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ public long getIdentifier() {
return this.id;
}

public void setId(Long id) {
public void setIdentifier(long id) {
checkAlive();
this.id = id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.kie.api.event.rule.MatchCancelledEvent;
import org.kie.api.event.rule.MatchCreatedEvent;
import org.kie.api.management.KieSessionMonitoringMBean;
import org.kie.api.runtime.KieSession;

import javax.management.ObjectName;
import java.util.Date;
Expand Down Expand Up @@ -58,7 +59,7 @@ public class KieSessionMonitoringImpl implements KieSessionMonitoringMBean {
public KieSessionMonitoringImpl(InternalWorkingMemory ksession) {
this.ksession = ksession;
this.kbase = ksession.getKnowledgeBase();
this.name = DroolsManagementAgent.createObjectName(KSESSION_PREFIX + ":type="+kbase.getId()+",group=Sessions,sessionId=Session-"+ksession.getId());
this.name = DroolsManagementAgent.createObjectName(KSESSION_PREFIX + ":type="+kbase.getId()+",group=Sessions,sessionId=Session-"+ksession.getIdentifier());
this.agendaStats = new AgendaStats();
this.processStats = new ProcessStats();
this.ksession.addEventListener( agendaStats );
Expand Down Expand Up @@ -108,7 +109,7 @@ public String getKieBaseId() {
* @see org.drools.core.management.KnowledgeSessionMonitoringMBean#getKnowledgeSessionId()
*/
public int getKieSessionId() {
return ksession.getId();
return ((KieSession)ksession).getId();
}

/* (non-Javadoc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private static ProtobufMessages.KnowledgeSession serializeSession(MarshallerWrit
_session.setProcessData( _pdata.build() );
}

Timers _timers = writeTimers( context.wm.getTimerService().getTimerJobInstances( context.wm.getId() ),
Timers _timers = writeTimers( context.wm.getTimerService().getTimerJobInstances( context.wm.getIdentifier() ),
context );
if ( _timers != null ) {
_session.setTimers( _timers );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public SingleSessionCommandService(KieBase kbase,
}

// update the session id to be the same as the session info id
((InternalKnowledgeRuntime) ksession).setId( this.sessionInfo.getId());
((InternalKnowledgeRuntime) ksession).setIdentifier( this.sessionInfo.getId());
}

protected void initNewKnowledgeSession(KieBase kbase, KieSessionConfiguration conf) {
Expand Down Expand Up @@ -243,7 +243,7 @@ protected void initExistingKnowledgeSession(Long sessionId,

// update the session id to be the same as the session info id
InternalKnowledgeRuntime kruntime = ((InternalKnowledgeRuntime) ksession);
kruntime.setId( this.sessionInfo.getId() );
kruntime.setIdentifier( this.sessionInfo.getId() );
kruntime.setEndOperationListener( new EndOperationListenerImpl( this.txm, this.sessionInfo ) );

if ( this.kContext == null ) {
Expand Down