Coverage Report - org.boretti.drools.integration.drools5.annotations.DroolsMethod
 
Classes in this File Line Coverage Branch Coverage Complexity
DroolsMethod
N/A
N/A
0
 
 1  
 /*
 2  
     Drools5 Integration Helper
 3  
     Copyright (C) 2009  Mathieu Boretti mathieu.boretti@gmail.com
 4  
 
 5  
     This program is free software: you can redistribute it and/or modify
 6  
     it under the terms of the GNU General Public License as published by
 7  
     the Free Software Foundation, either version 3 of the License, or
 8  
     (at your option) any later version.
 9  
 
 10  
     This program is distributed in the hope that it will be useful,
 11  
     but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  
     GNU General Public License for more details.
 14  
 
 15  
     You should have received a copy of the GNU General Public License
 16  
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 17  
 
 18  
  */
 19  
 package org.boretti.drools.integration.drools5.annotations;
 20  
 
 21  
 import java.lang.annotation.Retention;
 22  
 import java.lang.annotation.Target;
 23  
 
 24  
 import org.boretti.drools.integration.drools5.DroolsSessionType;
 25  
 
 26  
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
 27  
 import static java.lang.annotation.ElementType.METHOD;
 28  
 
 29  
 /**
 30  
  * This annotations marks a method of an interface that map to drools rules.
 31  
  * 
 32  
  * Usage of this annotation is optional. If omitted, session is assumed as NONE.
 33  
  * 
 34  
  * @author mbo
 35  
  *
 36  
  */
 37  
 @Retention(RUNTIME)
 38  
 @Target(METHOD)
 39  
 public @interface DroolsMethod {
 40  
         /**
 41  
          * This is the session type.
 42  
          * <ul>
 43  
          * <li>NONE=purely stateless</li>
 44  
          * <li>NEW=every time create a new session</li>
 45  
          * <li>END=every time delete the existing session at the end</li>
 46  
          * <li>JOIN=use existing session or if no session execute stateless</li>
 47  
          * <li>REQUIRE=must be used from within a session</ul>
 48  
          * </ul>
 49  
          * @return
 50  
          */
 51  
         DroolsSessionType session() default DroolsSessionType.NONE;
 52  
 }