PageRenderTime 25ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/drools-pipeline/src/main/java/org/drools/runtime/pipeline/impl/CorePipelineProviderImpl.java

https://github.com/esteban-aliverti/droolsjbpm-integration
Java | 131 lines | 90 code | 26 blank | 15 comment | 0 complexity | ce0b5c1bbf2de8b7fb42a5545fdb4642 MD5 | raw file
  1. /*
  2. * Copyright 2010 JBoss Inc
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.drools.runtime.pipeline.impl;
  17. import java.util.List;
  18. import org.drools.command.runtime.rule.InsertElementsCommand;
  19. import org.drools.runtime.StatefulKnowledgeSession;
  20. import org.drools.runtime.StatelessKnowledgeSession;
  21. import org.drools.runtime.pipeline.Action;
  22. import org.drools.runtime.pipeline.Callable;
  23. import org.drools.runtime.pipeline.CorePipelineProvider;
  24. import org.drools.runtime.pipeline.Expression;
  25. import org.drools.runtime.pipeline.Join;
  26. import org.drools.runtime.pipeline.KnowledgeRuntimeCommand;
  27. import org.drools.runtime.pipeline.ListAdapter;
  28. import org.drools.runtime.pipeline.Pipeline;
  29. import org.drools.runtime.pipeline.Splitter;
  30. public class CorePipelineProviderImpl
  31. implements
  32. CorePipelineProvider {
  33. public Pipeline newStatefulKnowledgeSessionPipeline(StatefulKnowledgeSession ksession) {
  34. return new StatefulKnowledgeSessionPipelineImpl( ksession );
  35. }
  36. public Pipeline newStatefulKnowledgeSessionPipeline(StatefulKnowledgeSession ksession,
  37. String entryPointName) {
  38. return new StatefulKnowledgeSessionPipelineImpl( ksession,
  39. entryPointName );
  40. }
  41. public Pipeline newStatelessKnowledgeSessionPipeline(StatelessKnowledgeSession ksession) {
  42. return new StatelessKnowledgeSessionPipelineImpl( ksession );
  43. }
  44. public KnowledgeRuntimeCommand newCommandExecutor() {
  45. return new ExecutorStage();
  46. }
  47. public KnowledgeRuntimeCommand newStatefulKnowledgeSessionInsert() {
  48. return new StatefulKnowledgeSessionInsertStage();
  49. }
  50. public KnowledgeRuntimeCommand newStatefulKnowledgeSessionGetGlobal() {
  51. return new StatefulKnowledgeSessionGetGlobalStage();
  52. }
  53. public KnowledgeRuntimeCommand newStatefulKnowledgeSessionSetGlobal() {
  54. return new StatefulKnowledgeSessionSetGlobalStage();
  55. }
  56. public KnowledgeRuntimeCommand newStatefulKnowledgeSessionSetGlobal(String identifier) {
  57. return new StatefulKnowledgeSessionSetGlobalStage( identifier );
  58. }
  59. public KnowledgeRuntimeCommand newStatefulKnowledgeSessionGetObject() {
  60. return new StatefulKnowledgeSessionGetObjectStage( );
  61. }
  62. public KnowledgeRuntimeCommand newStatefulKnowledgeSessionSignalEvent(String eventType) {
  63. return new StatefulKnowledgeSessionSignalEventStage( eventType );
  64. }
  65. public KnowledgeRuntimeCommand newStatefulKnowledgeSessionSignalEvent(String eventType,
  66. long id) {
  67. return new StatefulKnowledgeSessionSignalEventStage( eventType,
  68. id );
  69. }
  70. public KnowledgeRuntimeCommand newStatefulKnowledgeSessionStartProcess(String id) {
  71. return new StatefulKnowledgeSessionStartProcessStage( id );
  72. }
  73. public Action newAssignObjectAsResult() {
  74. return new AssignObjectAsResult();
  75. }
  76. public Action newExecuteResultHandler() {
  77. return new ExecuteResultHandler();
  78. }
  79. public Action newMvelAction(String action) {
  80. return new MvelAction( action );
  81. }
  82. public Expression newMvelExpression(String expression) {
  83. return new MvelExpression( expression );
  84. }
  85. public Splitter newIterateSplitter() {
  86. return new IterateSplitter();
  87. }
  88. public Join newListCollectJoin() {
  89. return new ListCollectJoin();
  90. }
  91. public ListAdapter newListAdapter(List<Object> list,
  92. boolean syncAccessors) {
  93. return new ListAdapterImpl( list,
  94. syncAccessors );
  95. }
  96. public Callable newCallable() {
  97. return new CallableImpl();
  98. }
  99. public KnowledgeRuntimeCommand newInsertElementsCommand() {
  100. return new InsertElementsCommandStage();
  101. }
  102. public KnowledgeRuntimeCommand newInsertObjectCommand() {
  103. return new InsertObjectCommandStage();
  104. }
  105. }