org.drools.jsr94.rules.Jsr94FactHandle Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of drools-jsr94 Show documentation
Show all versions of drools-jsr94 Show documentation
Implements the JSR-94 API with Drools.
/*
* Copyright 2015 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.drools.jsr94.rules;
import org.drools.core.WorkingMemoryEntryPoint;
import org.drools.core.common.DefaultFactHandle;
import org.kie.api.runtime.rule.EntryPoint;
import javax.rules.Handle;
/**
* The Drools implementation of the Handle
interface which provides
* a marker interface for Drools-specific object identity mechanism. When using
* the StatefulRuleSession
objects that are added to rule session
* state are identified using a Drools-supplied Handle
* implementation.
*
* Handle
s are used to unambigiously identify objects within the
* rule session state and should not suffer many of the object identity issues
* that arise when using muliple class loaders, serializing
* StatefulRuleSessions
, or using Object.equals
or
* object1 == object2
reference equality.
*/
public class Jsr94FactHandle extends DefaultFactHandle
implements
Handle {
private static final long serialVersionUID = 510l;
/**
* Constructs a new Handle
.
*
* @param id A unique Handle
id.
* @param recency A value indicating the recency of this Handle
* (more recently created Handle
s have greater values
* than Handle
s created further in the past)
*/
Jsr94FactHandle(final long id,
final Object object,
final long recency,
final EntryPoint entryPoint) {
super( (int) id,
object,
recency,
(WorkingMemoryEntryPoint)entryPoint );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy