Author: mar...@jb... Date: 2006-05-30 13:56:18 -0400 (Tue, 30 May 2006) New Revision: 4488 Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/AbstractRuleSessionImpl.java labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/Jsr94FactHandle.java labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/Jsr94FactHandleFactory.java labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/RuleExecutionSetMetadataImpl.java labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/RuleRuntimeImpl.java labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/StatefulRuleSessionImpl.java labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/StatelessRuleSessionImpl.java labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/LocalRuleExecutionSetProviderImpl.java labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleAdministratorImpl.java labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleExecutionSetImpl.java labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleExecutionSetProviderImpl.java labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleExecutionSetRepository.java labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleImpl.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/ExampleRuleEngineFacade.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/JSR94TestBase.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/MultipleRepositoryTest.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/Person.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/RuleEngineTestBase.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/RuleRuntimeTest.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/RuleServiceProviderTest.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/StatefulRuleSessionTest.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/StatelessRuleSessionTest.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/admin/LocalRuleExecutionSetProviderTest.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/admin/RuleAdministratorTest.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/admin/RuleExecutionSetProviderTest.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/admin/RuleExecutionSetTest.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/admin/RuleTest.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/jcp/jsr94/tck/AllTests.java Log: JBRULES-266 Customize how drools checks if an object is already asserted in its working memory JBRULES-233 LogicalAssertions Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/AbstractRuleSessionImpl.java =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/AbstractRuleSessionImpl.java 2006-05-30 17:55:59 UTC (rev 4487) +++ labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/AbstractRuleSessionImpl.java 2006-05-30 17:56:18 UTC (rev 4488) @@ -29,7 +29,6 @@ import javax.rules.StatelessRuleSession; import javax.rules.admin.RuleExecutionSet; -import org.drools.InitialFact; import org.drools.WorkingMemory; import org.drools.jsr94.rules.admin.RuleExecutionSetImpl; import org.drools.jsr94.rules.admin.RuleExecutionSetRepository; @@ -52,20 +51,21 @@ * @author N. Alex Rupp (n_alex <at>codehaus.org) * @author <a href="mailto:tho...@so...">thomas diesler </a> */ -abstract class AbstractRuleSessionImpl implements RuleSession -{ - private RuleExecutionSetRepository repository; - - public AbstractRuleSessionImpl(RuleExecutionSetRepository repository) { - super(); - this.repository = repository; - } - +abstract class AbstractRuleSessionImpl + implements + RuleSession { + private RuleExecutionSetRepository repository; + + public AbstractRuleSessionImpl(final RuleExecutionSetRepository repository) { + super(); + this.repository = repository; + } + /** * The Drools <code>WorkingMemory</code> associated * with this <code>RuleSession</code>. */ - private WorkingMemory workingMemory; + private WorkingMemory workingMemory; /** * The Drools <code>RuleExecutionSet</code> associated @@ -77,7 +77,7 @@ * A <code>Map</code> of <code>String</code>/<code>Object</code> pairs * passed as application data to the Drools <code>WorkingMemory</code>. */ - private Map properties; + private Map properties; /** * Initialize this <code>RuleSession</code> @@ -85,9 +85,8 @@ * * @see #newWorkingMemory() */ - protected void initWorkingMemory( ) - { - this.setWorkingMemory( this.newWorkingMemory( ) ); + protected void initWorkingMemory() { + this.setWorkingMemory( this.newWorkingMemory() ); } /** @@ -102,20 +101,15 @@ * @see #setProperties(Map) * @see WorkingMemory#setApplicationData(String, Object) */ - protected WorkingMemory newWorkingMemory( ) - { - WorkingMemory newWorkingMemory = - this.getRuleExecutionSet( ).newWorkingMemory( ); + protected WorkingMemory newWorkingMemory() { + final WorkingMemory newWorkingMemory = this.getRuleExecutionSet().newWorkingMemory(); - Map props = this.getProperties( ); - if ( props != null ) - { - for ( Iterator iterator = props.entrySet( ).iterator( ); - iterator.hasNext( ); ) - { - Map.Entry entry = ( Map.Entry ) iterator.next( ); - newWorkingMemory.setGlobal( - ( String ) entry.getKey( ), entry.getValue( ) ); + final Map props = this.getProperties(); + if ( props != null ) { + for ( final Iterator iterator = props.entrySet().iterator(); iterator.hasNext(); ) { + final Map.Entry entry = (Map.Entry) iterator.next(); + newWorkingMemory.setGlobal( (String) entry.getKey(), + entry.getValue() ); } } @@ -128,8 +122,7 @@ * @param properties additional properties used to create the * <code>RuleSession</code> implementation. */ - protected void setProperties( Map properties ) - { + protected void setProperties(final Map properties) { this.properties = properties; } @@ -140,8 +133,7 @@ * @return the additional properties used to create this * <code>RuleSession</code>. */ - protected Map getProperties( ) - { + protected Map getProperties() { return this.properties; } @@ -152,8 +144,7 @@ * @param workingMemory the <code>WorkingMemory</code> to associate * with this <code>RuleSession</code>. */ - protected void setWorkingMemory( WorkingMemory workingMemory ) - { + protected void setWorkingMemory(final WorkingMemory workingMemory) { this.workingMemory = workingMemory; } @@ -164,8 +155,7 @@ * @return the Drools <code>WorkingMemory</code> to associate * with this <code>RuleSession</code>. */ - protected WorkingMemory getWorkingMemory( ) - { + protected WorkingMemory getWorkingMemory() { return this.workingMemory; } @@ -176,8 +166,7 @@ * @param ruleExecutionSet the Drools <code>RuleExecutionSet</code> to associate * with this <code>RuleSession</code>. */ - protected void setRuleExecutionSet( RuleExecutionSetImpl ruleExecutionSet ) - { + protected void setRuleExecutionSet(final RuleExecutionSetImpl ruleExecutionSet) { this.ruleExecutionSet = ruleExecutionSet; } @@ -188,8 +177,7 @@ * @return the Drools <code>RuleExecutionSet</code> associated * with this <code>RuleSession</code>. */ - protected RuleExecutionSetImpl getRuleExecutionSet( ) - { + protected RuleExecutionSetImpl getRuleExecutionSet() { return this.ruleExecutionSet; } @@ -199,11 +187,8 @@ * * @throws InvalidRuleSessionException on illegal rule session state. */ - protected void checkRuleSessionValidity( ) - throws InvalidRuleSessionException - { - if ( this.workingMemory == null ) - { + protected void checkRuleSessionValidity() throws InvalidRuleSessionException { + if ( this.workingMemory == null ) { throw new InvalidRuleSessionException( "invalid rule session" ); } } @@ -216,17 +201,13 @@ * @param objects <code>List</code> of <code>Object</code>s to be filtered * @param objectFilter the <code>ObjectFilter</code> to be applied */ - protected void applyFilter( List objects, ObjectFilter objectFilter ) - { - if ( objectFilter != null ) - { - for ( Iterator objectIter = objects.iterator( ); - objectIter.hasNext( ); ) - { - Object object = objectIter.next( ); - if ( objectFilter.filter( object ) == null ) - { - objectIter.remove( ); + protected void applyFilter(final List objects, + final ObjectFilter objectFilter) { + if ( objectFilter != null ) { + for ( final Iterator objectIter = objects.iterator(); objectIter.hasNext(); ) { + final Object object = objectIter.next(); + if ( objectFilter.filter( object ) == null ) { + objectIter.remove(); } } } @@ -240,26 +221,20 @@ * * @return the RuleExecutionSetMetaData bound to this rule session. */ - public RuleExecutionSetMetadata getRuleExecutionSetMetadata( ) - { + public RuleExecutionSetMetadata getRuleExecutionSetMetadata() { String theBindUri = null; - for ( Iterator i = repository.getRegistrations( ).iterator( ); - i.hasNext( ); ) - { - String aBindUri = ( String ) i.next( ); - RuleExecutionSet aRuleSet = - repository.getRuleExecutionSet( aBindUri ); - if ( aRuleSet == this.ruleExecutionSet ) - { + for ( final Iterator i = this.repository.getRegistrations().iterator(); i.hasNext(); ) { + final String aBindUri = (String) i.next(); + final RuleExecutionSet aRuleSet = this.repository.getRuleExecutionSet( aBindUri ); + if ( aRuleSet == this.ruleExecutionSet ) { theBindUri = aBindUri; break; } } - return new RuleExecutionSetMetadataImpl( - theBindUri, - this.ruleExecutionSet.getName( ), - this.ruleExecutionSet.getDescription( ) ); + return new RuleExecutionSetMetadataImpl( theBindUri, + this.ruleExecutionSet.getName(), + this.ruleExecutionSet.getDescription() ); } /** @@ -273,15 +248,12 @@ * @see RuleRuntime#STATEFUL_SESSION_TYPE * @see RuleRuntime#STATELESS_SESSION_TYPE */ - public int getType( ) throws InvalidRuleSessionException - { - if ( this instanceof StatelessRuleSession ) - { + public int getType() throws InvalidRuleSessionException { + if ( this instanceof StatelessRuleSession ) { return RuleRuntime.STATELESS_SESSION_TYPE; } - if ( this instanceof StatefulRuleSession ) - { + if ( this instanceof StatefulRuleSession ) { return RuleRuntime.STATEFUL_SESSION_TYPE; } @@ -293,8 +265,7 @@ * This method renders this rule session unusable until * it is reacquired through the <code>RuleRuntime</code>. */ - public void release( ) - { + public void release() { this.setProperties( null ); this.setWorkingMemory( null ); this.setRuleExecutionSet( null ); @@ -308,8 +279,7 @@ * A reset will not reset the state on the default object filter for a * <code>RuleExecutionSet</code>. */ - public void reset( ) - { - this.initWorkingMemory( ); + public void reset() { + this.initWorkingMemory(); } } Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/Jsr94FactHandle.java =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/Jsr94FactHandle.java 2006-05-30 17:55:59 UTC (rev 4487) +++ labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/Jsr94FactHandle.java 2006-05-30 17:56:18 UTC (rev 4488) @@ -43,7 +43,7 @@ import javax.rules.Handle; -import org.drools.reteoo.FactHandleImpl; +import org.drools.common.DefaultFactHandle; /** * The Drools implementation of the <code>Handle</code> interface which provides @@ -58,8 +58,9 @@ * <code>StatefulRuleSessions</code>, or using <code>Object.equals</code> or * <code>object1 == object2</code> reference equality. */ -public class Jsr94FactHandle extends FactHandleImpl implements Handle -{ +public class Jsr94FactHandle extends DefaultFactHandle + implements + Handle { /** * Constructs a new <code>Handle</code>. * @@ -70,8 +71,11 @@ * * @see org.drools.conflict.RecencyConflictResolver */ - Jsr94FactHandle( long id, long recency ) - { - super( id, recency ); + Jsr94FactHandle(final long id, + final Object object, + final long recency) { + super( id, + object, + recency ); } } Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/Jsr94FactHandleFactory.java =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/Jsr94FactHandleFactory.java 2006-05-30 17:55:59 UTC (rev 4487) +++ labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/Jsr94FactHandleFactory.java 2006-05-30 17:56:18 UTC (rev 4488) @@ -16,53 +16,36 @@ * limitations under the License. */ -import org.drools.FactHandle; +import org.drools.common.AbstractFactHandleFactory; +import org.drools.common.DefaultFactHandle; +import org.drools.common.InternalFactHandle; import org.drools.spi.FactHandleFactory; /** * A factory for creating <code>Handle</code>s. * @author <a href="mailto:mic...@sy...">michael frandsen </a> */ -public final class Jsr94FactHandleFactory - implements - FactHandleFactory { - /** - * - */ - private static final long serialVersionUID = 1L; +public final class Jsr94FactHandleFactory extends AbstractFactHandleFactory { - /** The fact id. */ - private long id; - - /** The number of facts created - used for recency. */ - private long counter; - /* (non-Javadoc) - * @see org.drools.reteoo.FactHandleFactory#newFactHandle() - */ - public final FactHandle newFactHandle() { - return newFactHandle( this.id++ ); - } - - /* (non-Javadoc) * @see org.drools.reteoo.FactHandleFactory#newFactHandle(long) */ - public final FactHandle newFactHandle(long id) { + protected final InternalFactHandle newFactHandle(final long id, + final Object object, + final long recency) { return new Jsr94FactHandle( id, - this.counter++ ); + object, + recency ); } /* (non-Javadoc) - * @see org.drools.reteoo.FactHandleFactory#increaseFactHandleRecency(org.drools.FactHandle) - */ - public final void increaseFactHandleRecency(FactHandle factHandle) { - ((Jsr94FactHandle) factHandle).setRecency( ++this.counter ); - } - - /* (non-Javadoc) * @see org.drools.reteoo.FactHandleFactory#newInstance() */ public FactHandleFactory newInstance() { return new Jsr94FactHandleFactory(); } + + public Class getFactHandleType() { + return DefaultFactHandle.class; + } } Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/RuleExecutionSetMetadataImpl.java =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/RuleExecutionSetMetadataImpl.java 2006-05-30 17:55:59 UTC (rev 4487) +++ labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/RuleExecutionSetMetadataImpl.java 2006-05-30 17:56:18 UTC (rev 4488) @@ -34,13 +34,13 @@ private static final long serialVersionUID = 1L; /** The URI for this <code>RuleExecutionSet</code>. */ - private final String uri; + private final String uri; /** The name of this RuleExecutionSet. */ - private final String name; + private final String name; /** The description of this <code>RuleExecutionSet</code>. */ - private final String description; + private final String description; /** * Constructs an instance of <code>RuleExecutionSetMetadata</code>. @@ -49,9 +49,9 @@ * @param name The name of this <code>RuleExecutionSet</code>. * @param description The description of this <code>RuleExecutionSet</code>. */ - public RuleExecutionSetMetadataImpl(String uri, - String name, - String description) { + public RuleExecutionSetMetadataImpl(final String uri, + final String name, + final String description) { this.uri = uri; this.name = name; this.description = description; Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/RuleRuntimeImpl.java =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/RuleRuntimeImpl.java 2006-05-30 17:55:59 UTC (rev 4487) +++ labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/RuleRuntimeImpl.java 2006-05-30 17:56:18 UTC (rev 4488) @@ -55,7 +55,7 @@ /** * Create a new <code>RuleRuntimeImpl</code>. */ - public RuleRuntimeImpl(RuleExecutionSetRepository repository) { + public RuleRuntimeImpl(final RuleExecutionSetRepository repository) { this.repository = repository; // no special initialization required } @@ -81,22 +81,22 @@ * * @return The created <code>RuleSession</code>. */ - public RuleSession createRuleSession(String uri, - Map properties, - int ruleSessionType) throws RuleSessionTypeUnsupportedException, - RuleExecutionSetNotFoundException { + public RuleSession createRuleSession(final String uri, + final Map properties, + final int ruleSessionType) throws RuleSessionTypeUnsupportedException, + RuleExecutionSetNotFoundException { if ( ruleSessionType == RuleRuntime.STATELESS_SESSION_TYPE ) { - StatelessRuleSessionImpl session = new StatelessRuleSessionImpl( uri, - properties, - repository ); + final StatelessRuleSessionImpl session = new StatelessRuleSessionImpl( uri, + properties, + this.repository ); return session; } if ( ruleSessionType == RuleRuntime.STATEFUL_SESSION_TYPE ) { - StatefulRuleSessionImpl session = new StatefulRuleSessionImpl( uri, - properties, - repository ); + final StatefulRuleSessionImpl session = new StatefulRuleSessionImpl( uri, + properties, + this.repository ); return session; } @@ -111,6 +111,6 @@ * @return a <code>List</code> of <code>String</code>s (URIs) */ public List getRegistrations() { - return repository.getRegistrations(); + return this.repository.getRegistrations(); } } Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/StatefulRuleSessionImpl.java =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/StatefulRuleSessionImpl.java 2006-05-30 17:55:59 UTC (rev 4487) +++ labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/StatefulRuleSessionImpl.java 2006-05-30 17:56:18 UTC (rev 4488) @@ -81,13 +81,13 @@ * @throws RuleExecutionSetNotFoundException * if there is no rule set under the given URI */ - StatefulRuleSessionImpl(String bindUri, - Map properties, - RuleExecutionSetRepository repository) throws RuleExecutionSetNotFoundException { + StatefulRuleSessionImpl(final String bindUri, + final Map properties, + final RuleExecutionSetRepository repository) throws RuleExecutionSetNotFoundException { super( repository ); this.setProperties( properties ); - RuleExecutionSetImpl ruleSet = (RuleExecutionSetImpl) repository.getRuleExecutionSet( bindUri ); + final RuleExecutionSetImpl ruleSet = (RuleExecutionSetImpl) repository.getRuleExecutionSet( bindUri ); if ( ruleSet == null ) { throw new RuleExecutionSetNotFoundException( "no execution set bound to: " + bindUri ); @@ -112,9 +112,9 @@ * @return <code>true</code> if the given object is contained within the * rule session state of this rule session. */ - public boolean containsObject(Handle objectHandle) { + public boolean containsObject(final Handle objectHandle) { if ( objectHandle instanceof FactHandle ) { - return this.getWorkingMemory().containsObject( (FactHandle) objectHandle ); + return this.getWorkingMemory().getObject( (FactHandle) objectHandle ) != null; } return false; @@ -135,12 +135,12 @@ * @throws InvalidRuleSessionException * on illegal rule session state. */ - public Handle addObject(Object object) throws InvalidRuleSessionException { + public Handle addObject(final Object object) throws InvalidRuleSessionException { this.checkRuleSessionValidity(); try { return (Handle) this.getWorkingMemory().assertObject( object ); - } catch ( FactException e ) { + } catch ( final FactException e ) { throw new InvalidRuleSessionException( "cannot assert object", e ); } @@ -160,12 +160,12 @@ * @throws InvalidRuleSessionException * on illegal rule session state. */ - public List addObjects(List objList) throws InvalidRuleSessionException { + public List addObjects(final List objList) throws InvalidRuleSessionException { this.checkRuleSessionValidity(); - List handles = new ArrayList(); + final List handles = new ArrayList(); - for ( Iterator objectIter = objList.iterator(); objectIter.hasNext(); ) { + for ( final Iterator objectIter = objList.iterator(); objectIter.hasNext(); ) { handles.add( this.addObject( objectIter.next() ) ); } return handles; @@ -188,16 +188,16 @@ * @throws InvalidHandleException * if the input <code>Handle</code> is no longer valid */ - public void updateObject(Handle objectHandle, - Object newObject) throws InvalidRuleSessionException, - InvalidHandleException { + public void updateObject(final Handle objectHandle, + final Object newObject) throws InvalidRuleSessionException, + InvalidHandleException { this.checkRuleSessionValidity(); if ( objectHandle instanceof FactHandle ) { try { this.getWorkingMemory().modifyObject( (FactHandle) objectHandle, newObject ); - } catch ( FactException e ) { + } catch ( final FactException e ) { throw new InvalidRuleSessionException( "cannot update object", e ); } @@ -219,14 +219,14 @@ * @throws InvalidHandleException * if the input <code>Handle</code> is no longer valid */ - public void removeObject(Handle handleObject) throws InvalidRuleSessionException, - InvalidHandleException { + public void removeObject(final Handle handleObject) throws InvalidRuleSessionException, + InvalidHandleException { this.checkRuleSessionValidity(); if ( handleObject instanceof FactHandle ) { try { this.getWorkingMemory().retractObject( (FactHandle) handleObject ); - } catch ( FactException e ) { + } catch ( final FactException e ) { throw new InvalidRuleSessionException( "cannot remove object", e ); } @@ -280,10 +280,10 @@ * @throws InvalidRuleSessionException * on illegal rule session state. */ - public List getObjects(ObjectFilter filter) throws InvalidRuleSessionException { + public List getObjects(final ObjectFilter filter) throws InvalidRuleSessionException { this.checkRuleSessionValidity(); - List objects = new ArrayList(); + final List objects = new ArrayList(); objects.addAll( this.getWorkingMemory().getObjects() ); @@ -315,14 +315,14 @@ /** * @see StatefulRuleSessionImpl */ - public Object getObject(Handle handle) throws InvalidRuleSessionException, - InvalidHandleException { + public Object getObject(final Handle handle) throws InvalidRuleSessionException, + InvalidHandleException { this.checkRuleSessionValidity(); if ( handle instanceof FactHandle ) { try { return this.getWorkingMemory().getObject( (FactHandle) handle ); - } catch ( NoSuchFactObjectException e ) { + } catch ( final NoSuchFactObjectException e ) { throw new InvalidHandleException( "invalid handle", e ); } @@ -339,9 +339,9 @@ * currect state of the rule session. */ public List getHandles() { - List handles = new LinkedList(); - for ( Iterator i = this.getWorkingMemory().getFactHandles().iterator(); i.hasNext(); ) { - Object object = i.next(); + final List handles = new LinkedList(); + for ( final Iterator i = this.getWorkingMemory().getFactHandles().iterator(); i.hasNext(); ) { + final Object object = i.next(); if ( object instanceof Handle ) { handles.add( object ); } Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/StatelessRuleSessionImpl.java =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/StatelessRuleSessionImpl.java 2006-05-30 17:55:59 UTC (rev 4487) +++ labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/StatelessRuleSessionImpl.java 2006-05-30 17:56:18 UTC (rev 4488) @@ -55,13 +55,13 @@ * @throws RuleExecutionSetNotFoundException * if there is no rule set under the given URI */ - StatelessRuleSessionImpl(String bindUri, - Map properties, - RuleExecutionSetRepository repository) throws RuleExecutionSetNotFoundException { + StatelessRuleSessionImpl(final String bindUri, + final Map properties, + final RuleExecutionSetRepository repository) throws RuleExecutionSetNotFoundException { super( repository ); this.setProperties( properties ); - RuleExecutionSetImpl ruleSet = (RuleExecutionSetImpl) repository.getRuleExecutionSet( bindUri ); + final RuleExecutionSetImpl ruleSet = (RuleExecutionSetImpl) repository.getRuleExecutionSet( bindUri ); if ( ruleSet == null ) { throw new RuleExecutionSetNotFoundException( "RuleExecutionSet unbound: " + bindUri ); @@ -93,7 +93,7 @@ * @throws InvalidRuleSessionException * on illegal rule session state. */ - public List executeRules(List objects) throws InvalidRuleSessionException { + public List executeRules(final List objects) throws InvalidRuleSessionException { return this.executeRules( objects, this.getRuleExecutionSet().getObjectFilter() ); } @@ -122,22 +122,22 @@ * @throws InvalidRuleSessionException * on illegal rule session state. */ - public List executeRules(List objects, - ObjectFilter filter) throws InvalidRuleSessionException { - WorkingMemory workingMemory = this.newWorkingMemory(); + public List executeRules(final List objects, + final ObjectFilter filter) throws InvalidRuleSessionException { + final WorkingMemory workingMemory = this.newWorkingMemory(); try { - for ( Iterator objectIter = objects.iterator(); objectIter.hasNext(); ) { + for ( final Iterator objectIter = objects.iterator(); objectIter.hasNext(); ) { workingMemory.assertObject( objectIter.next() ); } workingMemory.fireAllRules(); - } catch ( FactException e ) { + } catch ( final FactException e ) { throw new InvalidRuleSessionException( e.getMessage(), e ); } - List results = workingMemory.getObjects(); + final List results = workingMemory.getObjects(); this.applyFilter( results, filter ); Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/LocalRuleExecutionSetProviderImpl.java =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/LocalRuleExecutionSetProviderImpl.java 2006-05-30 17:55:59 UTC (rev 4487) +++ labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/LocalRuleExecutionSetProviderImpl.java 2006-05-30 17:56:18 UTC (rev 4488) @@ -44,146 +44,148 @@ * @author <a href="mailto:tho...@so...">thomas diesler </a> * @author <a href="mailto:mic...@sy...">michael frandsen </a> */ -public class LocalRuleExecutionSetProviderImpl implements - LocalRuleExecutionSetProvider { - /** Default constructor. */ - public LocalRuleExecutionSetProviderImpl() { - super(); - } +public class LocalRuleExecutionSetProviderImpl + implements + LocalRuleExecutionSetProvider { + /** Default constructor. */ + public LocalRuleExecutionSetProviderImpl() { + super(); + } - /** - * Creates a <code>RuleExecutionSet</code> implementation using a supplied - * input stream and additional Drools-specific properties. A Drools-specific - * rule execution set is read from the supplied InputStream. The method - * <code>createRuleExecutionSet</code> taking a Reader instance should be - * used if the source is a character stream and encoding conversion should - * be performed. - * - * @param ruleExecutionSetStream - * an input stream used to read the rule execution set. - * @param properties - * additional properties used to create the - * <code>RuleExecutionSet</code> implementation. May be - * <code>null</code>. - * - * @throws RuleExecutionSetCreateException - * on rule execution set creation error. - * - * @return The created <code>RuleExecutionSet</code>. - */ - public RuleExecutionSet createRuleExecutionSet( - InputStream ruleExecutionSetStream, Map properties) - throws RuleExecutionSetCreateException { - try { - PackageBuilder builder = new PackageBuilder(); - if (properties != null && properties.containsKey("dsl")) { - Reader dsl = new StringReader( (String) properties.get("dsl") ); - builder.addPackageFromDrl(new InputStreamReader(ruleExecutionSetStream), dsl); + /** + * Creates a <code>RuleExecutionSet</code> implementation using a supplied + * input stream and additional Drools-specific properties. A Drools-specific + * rule execution set is read from the supplied InputStream. The method + * <code>createRuleExecutionSet</code> taking a Reader instance should be + * used if the source is a character stream and encoding conversion should + * be performed. + * + * @param ruleExecutionSetStream + * an input stream used to read the rule execution set. + * @param properties + * additional properties used to create the + * <code>RuleExecutionSet</code> implementation. May be + * <code>null</code>. + * + * @throws RuleExecutionSetCreateException + * on rule execution set creation error. + * + * @return The created <code>RuleExecutionSet</code>. + */ + public RuleExecutionSet createRuleExecutionSet(final InputStream ruleExecutionSetStream, + final Map properties) throws RuleExecutionSetCreateException { + try { + final PackageBuilder builder = new PackageBuilder(); + if ( properties != null && properties.containsKey( "dsl" ) ) { + final Reader dsl = new StringReader( (String) properties.get( "dsl" ) ); + builder.addPackageFromDrl( new InputStreamReader( ruleExecutionSetStream ), + dsl ); } else { - builder.addPackageFromDrl(new InputStreamReader( - ruleExecutionSetStream)); + builder.addPackageFromDrl( new InputStreamReader( ruleExecutionSetStream ) ); } - Package pkg = builder.getPackage(); - return this.createRuleExecutionSet(pkg, properties); - } catch (IOException e) { - throw new RuleExecutionSetCreateException( - "cannot create rule execution set", e); - } catch (DroolsParserException e) { - throw new RuleExecutionSetCreateException( - "cannot create rule execution set", e); - } - } + final Package pkg = builder.getPackage(); + return this.createRuleExecutionSet( pkg, + properties ); + } catch ( final IOException e ) { + throw new RuleExecutionSetCreateException( "cannot create rule execution set", + e ); + } catch ( final DroolsParserException e ) { + throw new RuleExecutionSetCreateException( "cannot create rule execution set", + e ); + } + } - /** - * Creates a <code>RuleExecutionSet</code> implementation using a supplied - * character stream Reader and additional Drools-specific properties. A - * Drools-specific rule execution set is read from the supplied Reader. - * - * @param ruleExecutionSetReader - * a Reader used to read the rule execution set. - * @param properties - * additional properties used to create the - * <code>RuleExecutionSet</code> implementation. May be - * <code>null</code>. - * - * @throws RuleExecutionSetCreateException - * on rule execution set creation error. - * - * @return The created <code>RuleExecutionSet</code>. - */ - public RuleExecutionSet createRuleExecutionSet( - Reader ruleExecutionSetReader, Map properties) - throws RuleExecutionSetCreateException { - try { - PackageBuilder builder = new PackageBuilder(); - if (properties != null && properties.containsKey("dsl")) { - Reader dsl = new StringReader( (String) properties.get("dsl") ); - builder.addPackageFromDrl(ruleExecutionSetReader, dsl); - } else { - builder.addPackageFromDrl(ruleExecutionSetReader); - } + /** + * Creates a <code>RuleExecutionSet</code> implementation using a supplied + * character stream Reader and additional Drools-specific properties. A + * Drools-specific rule execution set is read from the supplied Reader. + * + * @param ruleExecutionSetReader + * a Reader used to read the rule execution set. + * @param properties + * additional properties used to create the + * <code>RuleExecutionSet</code> implementation. May be + * <code>null</code>. + * + * @throws RuleExecutionSetCreateException + * on rule execution set creation error. + * + * @return The created <code>RuleExecutionSet</code>. + */ + public RuleExecutionSet createRuleExecutionSet(final Reader ruleExecutionSetReader, + final Map properties) throws RuleExecutionSetCreateException { + try { + final PackageBuilder builder = new PackageBuilder(); + if ( properties != null && properties.containsKey( "dsl" ) ) { + final Reader dsl = new StringReader( (String) properties.get( "dsl" ) ); + builder.addPackageFromDrl( ruleExecutionSetReader, + dsl ); + } else { + builder.addPackageFromDrl( ruleExecutionSetReader ); + } - Package pkg = builder.getPackage(); - return this.createRuleExecutionSet(pkg, properties); - } catch (IOException e) { - throw new RuleExecutionSetCreateException( - "cannot create rule execution set", e); - } catch (DroolsParserException e) { - throw new RuleExecutionSetCreateException( - "cannot create rule execution set", e); - } - } + final Package pkg = builder.getPackage(); + return this.createRuleExecutionSet( pkg, + properties ); + } catch ( final IOException e ) { + throw new RuleExecutionSetCreateException( "cannot create rule execution set", + e ); + } catch ( final DroolsParserException e ) { + throw new RuleExecutionSetCreateException( "cannot create rule execution set", + e ); + } + } - /** - * Creates a <code>RuleExecutionSet</code> implementation from a - * Drools-specific AST representation and Drools-specific properties. - * - * @param ruleExecutionSetAst - * the vendor representation of a rule execution set - * @param properties - * additional properties used to create the - * <code>RuleExecutionSet</code> implementation. May be - * <code>null</code>. - * - * @throws RuleExecutionSetCreateException - * on rule execution set creation error. - * - * @return The created <code>RuleExecutionSet</code>. - */ - public RuleExecutionSet createRuleExecutionSet(Object ruleExecutionSetAst, - Map properties) throws RuleExecutionSetCreateException { - if (ruleExecutionSetAst instanceof Package) { - Package pkg = (Package) ruleExecutionSetAst; - return this.createRuleExecutionSet(pkg, properties); - } - throw new RuleExecutionSetCreateException( - " Incoming AST object must be an org.drools.rule.Package. Was " - + ruleExecutionSetAst.getClass()); - } + /** + * Creates a <code>RuleExecutionSet</code> implementation from a + * Drools-specific AST representation and Drools-specific properties. + * + * @param ruleExecutionSetAst + * the vendor representation of a rule execution set + * @param properties + * additional properties used to create the + * <code>RuleExecutionSet</code> implementation. May be + * <code>null</code>. + * + * @throws RuleExecutionSetCreateException + * on rule execution set creation error. + * + * @return The created <code>RuleExecutionSet</code>. + */ + public RuleExecutionSet createRuleExecutionSet(final Object ruleExecutionSetAst, + final Map properties) throws RuleExecutionSetCreateException { + if ( ruleExecutionSetAst instanceof Package ) { + final Package pkg = (Package) ruleExecutionSetAst; + return this.createRuleExecutionSet( pkg, + properties ); + } + throw new RuleExecutionSetCreateException( " Incoming AST object must be an org.drools.rule.Package. Was " + ruleExecutionSetAst.getClass() ); + } - /** - * Creates a <code>RuleExecutionSet</code> implementation from a - * <code>RuleSet</code> and Drools-specific properties. - * - * @param pkg - * a Drools <code>org.drools.rule.Package</code> representation - * of a rule execution set. - * @param properties - * additional properties used to create the RuleExecutionSet - * implementation. May be <code>null</code>. - * - * @throws RuleExecutionSetCreateException - * on rule execution set creation error. - * - * @return The created <code>RuleExecutionSet</code>. - */ - private RuleExecutionSet createRuleExecutionSet(Package pkg, Map properties) - throws RuleExecutionSetCreateException { - try { - return new RuleExecutionSetImpl(pkg, properties); - } catch (IntegrationException e) { - throw new RuleExecutionSetCreateException( - "Failed to create RuleExecutionSet", e); - } - } + /** + * Creates a <code>RuleExecutionSet</code> implementation from a + * <code>RuleSet</code> and Drools-specific properties. + * + * @param pkg + * a Drools <code>org.drools.rule.Package</code> representation + * of a rule execution set. + * @param properties + * additional properties used to create the RuleExecutionSet + * implementation. May be <code>null</code>. + * + * @throws RuleExecutionSetCreateException + * on rule execution set creation error. + * + * @return The created <code>RuleExecutionSet</code>. + */ + private RuleExecutionSet createRuleExecutionSet(final Package pkg, + final Map properties) throws RuleExecutionSetCreateException { + try { + return new RuleExecutionSetImpl( pkg, + properties ); + } catch ( final IntegrationException e ) { + throw new RuleExecutionSetCreateException( "Failed to create RuleExecutionSet", + e ); + } + } } Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleAdministratorImpl.java =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleAdministratorImpl.java 2006-05-30 17:55:59 UTC (rev 4487) +++ labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleAdministratorImpl.java 2006-05-30 17:56:18 UTC (rev 4488) @@ -52,7 +52,7 @@ private RuleExecutionSetRepository repository; /** Default constructor. */ - public RuleAdministratorImpl(RuleExecutionSetRepository repository) { + public RuleAdministratorImpl(final RuleExecutionSetRepository repository) { super(); this.repository = repository; } @@ -65,7 +65,7 @@ * * @return The created <code>RuleExecutionSetProvider</code>. */ - public RuleExecutionSetProvider getRuleExecutionSetProvider(Map properties) { + public RuleExecutionSetProvider getRuleExecutionSetProvider(final Map properties) { return new RuleExecutionSetProviderImpl(); } @@ -81,7 +81,7 @@ * * @return The created <code>LocalRuleExecutionSetProvider</code>. */ - public LocalRuleExecutionSetProvider getLocalRuleExecutionSetProvider(Map properties) { + public LocalRuleExecutionSetProvider getLocalRuleExecutionSetProvider(final Map properties) { return new LocalRuleExecutionSetProviderImpl(); } @@ -104,12 +104,12 @@ * @throws RuleExecutionSetRegisterException * if an error occurred that prevented registration */ - public void registerRuleExecutionSet(String bindUri, - RuleExecutionSet set, - Map properties) throws RuleExecutionSetRegisterException { + public void registerRuleExecutionSet(final String bindUri, + final RuleExecutionSet set, + final Map properties) throws RuleExecutionSetRegisterException { // Note: an existing RuleExecutionSet is simply replaced - repository.registerRuleExecutionSet( bindUri, - set ); + this.repository.registerRuleExecutionSet( bindUri, + set ); } /** @@ -124,12 +124,12 @@ * @throws RuleExecutionSetDeregistrationException * if an error occurred that prevented unregistration */ - public void deregisterRuleExecutionSet(String bindUri, - Map properties) throws RuleExecutionSetDeregistrationException { - if ( repository.getRuleExecutionSet( bindUri ) == null ) { + public void deregisterRuleExecutionSet(final String bindUri, + final Map properties) throws RuleExecutionSetDeregistrationException { + if ( this.repository.getRuleExecutionSet( bindUri ) == null ) { throw new RuleExecutionSetDeregistrationException( "no execution set bound to: " + bindUri ); } - repository.unregisterRuleExecutionSet( bindUri ); + this.repository.unregisterRuleExecutionSet( bindUri ); } } Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleExecutionSetImpl.java =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleExecutionSetImpl.java 2006-05-30 17:55:59 UTC (rev 4487) +++ labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleExecutionSetImpl.java 2006-05-30 17:56:18 UTC (rev 4488) @@ -103,8 +103,8 @@ * a <code>Rule</code> or <code>Package</code> * into the <code>RuleBase</code> */ - RuleExecutionSetImpl(Package pkg, - Map properties) throws IntegrationException { + RuleExecutionSetImpl(final Package pkg, + final Map properties) throws IntegrationException { if ( null == properties ) { this.properties = new HashMap(); } else { @@ -113,7 +113,7 @@ this.pkg = pkg; this.description = pkg.getName();//..getDocumentation( ); - org.drools.reteoo.RuleBaseImpl ruleBase = new org.drools.reteoo.RuleBaseImpl(new Jsr94FactHandleFactory()); + final org.drools.reteoo.ReteooRuleBase ruleBase = new org.drools.reteoo.ReteooRuleBase( new Jsr94FactHandleFactory() ); ruleBase.addPackage( pkg ); this.ruleBase = ruleBase; @@ -137,13 +137,13 @@ } try { - Class filterClass = cl.loadClass( this.defaultObjectFilterClassName ); + final Class filterClass = cl.loadClass( this.defaultObjectFilterClassName ); this.objectFilter = (ObjectFilter) filterClass.newInstance(); - } catch ( ClassNotFoundException e ) { + } catch ( final ClassNotFoundException e ) { throw new RuntimeException( e.toString() ); - } catch ( InstantiationException e ) { + } catch ( final InstantiationException e ) { throw new RuntimeException( e.toString() ); - } catch ( IllegalAccessException e ) { + } catch ( final IllegalAccessException e ) { throw new RuntimeException( e.toString() ); } } @@ -188,7 +188,7 @@ * * @return the value bound to the key or null */ - public Object getProperty(Object key) { + public Object getProperty(final Object key) { return this.properties.get( key ); } @@ -198,8 +198,8 @@ * @param key the key for the property value * @param value the value to associate with the key */ - public void setProperty(Object key, - Object value) { + public void setProperty(final Object key, + final Object value) { this.properties.put( key, value ); } @@ -215,7 +215,7 @@ * * @param objectFilterClassname the default <code>ObjectFilter</code> class */ - public void setDefaultObjectFilter(String objectFilterClassname) { + public void setDefaultObjectFilter(final String objectFilterClassname) { this.defaultObjectFilterClassName = objectFilterClassname; } @@ -237,9 +237,9 @@ * <code>RuleExecutionSet</code>. */ public List getRules() { - List jsr94Rules = new ArrayList(); + final List jsr94Rules = new ArrayList(); - Rule[] rules = (this.pkg.getRules()); + final Rule[] rules = (this.pkg.getRules()); for ( int i = 0; i < rules.length; ++i ) { jsr94Rules.add( new RuleImpl( rules[i] ) ); } Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleExecutionSetProviderImpl.java =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleExecutionSetProviderImpl.java 2006-05-30 17:55:59 UTC (rev 4487) +++ labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleExecutionSetProviderImpl.java 2006-05-30 17:56:18 UTC (rev 4488) @@ -21,25 +21,12 @@ import java.io.InputStreamReader; import java.io.Reader; import java.io.Serializable; -import java.io.StringReader; -import java.io.StringWriter; import java.net.URL; import java.util.Map; import javax.rules.admin.RuleExecutionSet; import javax.rules.admin.RuleExecutionSetCreateException; import javax.rules.admin.RuleExecutionSetProvider; - -import org.apache.xml.serialize.OutputFormat; -import org.apache.xml.serialize.XMLSerializer; -import org.drools.compiler.PackageBuilder; -import org.drools.lang.descr.PackageDescr; -import org.drools.rule.Package; -import org.drools.xml.XmlPackageReader; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; @@ -47,6 +34,12 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.sax.SAXResult; +import org.drools.compiler.PackageBuilder; +import org.drools.lang.descr.PackageDescr; +import org.drools.rule.Package; +import org.drools.xml.XmlPackageReader; +import org.w3c.dom.Element; + /** * The Drools implementation of the <code>RuleExecutionSetProvider</code> * interface which defines <code>RuleExecutionSet</code> creation methods for @@ -78,42 +71,37 @@ * * @return The created <code>RuleExecutionSet</code>. */ - public RuleExecutionSet createRuleExecutionSet(Element ruleExecutionSetElement, - Map properties) throws RuleExecutionSetCreateException { - try - { -// Prepare the DOM source - Source source = new DOMSource( ruleExecutionSetElement ); + public RuleExecutionSet createRuleExecutionSet(final Element ruleExecutionSetElement, + final Map properties) throws RuleExecutionSetCreateException { + try { + // Prepare the DOM source + final Source source = new DOMSource( ruleExecutionSetElement ); - XmlPackageReader xmlPackageReader = new XmlPackageReader( ); - // Prepare the result - SAXResult result = new SAXResult( xmlPackageReader ); + final XmlPackageReader xmlPackageReader = new XmlPackageReader(); + // Prepare the result + final SAXResult result = new SAXResult( xmlPackageReader ); - // Create a transformer - Transformer xformer = - TransformerFactory.newInstance( ).newTransformer( ); + // Create a transformer + final Transformer xformer = TransformerFactory.newInstance().newTransformer(); - // Traverse the DOM tree - xformer.transform( source, result ); + // Traverse the DOM tree + xformer.transform( source, + result ); - PackageDescr packageDescr = xmlPackageReader.getPackageDescr(); + final PackageDescr packageDescr = xmlPackageReader.getPackageDescr(); - // pre build the package - PackageBuilder builder = new PackageBuilder(); - builder.addPackage( packageDescr ); - Package pkg = builder.getPackage(); + // pre build the package + final PackageBuilder builder = new PackageBuilder(); + builder.addPackage( packageDescr ); + final Package pkg = builder.getPackage(); - LocalRuleExecutionSetProviderImpl localRuleExecutionSetProvider = new LocalRuleExecutionSetProviderImpl(); - return localRuleExecutionSetProvider.createRuleExecutionSet( pkg, - properties ); - } - catch ( TransformerException e ) - { - throw new RuleExecutionSetCreateException( - "could not create RuleExecutionSet: " + e ); - } + final LocalRuleExecutionSetProviderImpl localRuleExecutionSetProvider = new LocalRuleExecutionSetProviderImpl(); + return localRuleExecutionSetProvider.createRuleExecutionSet( pkg, + properties ); + } catch ( final TransformerException e ) { + throw new RuleExecutionSetCreateException( "could not create RuleExecutionSet: " + e ); + } - } /** @@ -135,10 +123,10 @@ * * @return The created <code>RuleExecutionSet</code>. */ - public RuleExecutionSet createRuleExecutionSet(Serializable ruleExecutionSetAst, - Map properties) throws RuleExecutionSetCreateException { + public RuleExecutionSet createRuleExecutionSet(final Serializable ruleExecutionSetAst, + final Map properties) throws RuleExecutionSetCreateException { if ( ruleExecutionSetAst instanceof Package ) { - LocalRuleExecutionSetProviderImpl localRuleExecutionSetProvider = new LocalRuleExecutionSetProviderImpl(); + final LocalRuleExecutionSetProviderImpl localRuleExecutionSetProvider = new LocalRuleExecutionSetProviderImpl(); return localRuleExecutionSetProvider.createRuleExecutionSet( ruleExecutionSetAst, properties ); } else { @@ -162,17 +150,17 @@ * * @return The created <code>RuleExecutionSet</code>. */ - public RuleExecutionSet createRuleExecutionSet(String ruleExecutionSetUri, - Map properties) throws RuleExecutionSetCreateException, - IOException { + public RuleExecutionSet createRuleExecutionSet(final String ruleExecutionSetUri, + final Map properties) throws RuleExecutionSetCreateException, + IOException { InputStream in = null; try { - LocalRuleExecutionSetProviderImpl localRuleExecutionSetProvider = new LocalRuleExecutionSetProviderImpl(); + final LocalRuleExecutionSetProviderImpl localRuleExecutionSetProvider = new LocalRuleExecutionSetProviderImpl(); in = new URL( ruleExecutionSetUri ).openStream(); - Reader reader = new InputStreamReader( in ); + final Reader reader = new InputStreamReader( in ); return localRuleExecutionSetProvider.createRuleExecutionSet( reader, properties ); - } catch ( IOException ex ) { + } catch ( final IOException ex ) { throw ex; } finally { if ( in != null ) { Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleExecutionSetRepository.java =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleExecutionSetRepository.java 2006-05-30 17:55:59 UTC (rev 4487) +++ labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/RuleExecutionSetRepository.java 2006-05-30 17:56:18 UTC (rev 4488) @@ -30,97 +30,98 @@ * * @author <a href="mailto:tho...@so...">thomas diesler </a> */ -public final class RuleExecutionSetRepository implements Serializable { - private static final long serialVersionUID = 1L; +public final class RuleExecutionSetRepository + implements + Serializable { + private static final long serialVersionUID = 1L; - /** The Singleton instance of the repository. */ - // private static RuleExecutionSetRepository REPOSITORY; - /** Holds t... [truncated message content] |