Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove support of deprecated brl files

  • Loading branch information...
commit 7b9603d029bd651dd5cfb92903ea956e9eeaf712 1 parent 4cf91e2
@mariofusco mariofusco authored
View
49 drools-compiler/src/main/java/org/drools/compiler/compiler/BusinessRuleProviderFactory.java
@@ -1,49 +0,0 @@
-/*
- * Copyright 2011 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * 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.compiler.compiler;
-
-import org.drools.core.CheckedDroolsException;
-import org.kie.internal.utils.ServiceRegistryImpl;
-
-public class BusinessRuleProviderFactory {
-
- private static BusinessRuleProviderFactory instance = new BusinessRuleProviderFactory();
- private static BusinessRuleProvider provider;
-
- private BusinessRuleProviderFactory() {
- }
-
- public static BusinessRuleProviderFactory getInstance() {
- return instance;
- }
-
- public BusinessRuleProvider getProvider() throws CheckedDroolsException {
- if ( null == provider ) loadProvider();
- return provider;
- }
-
- public static synchronized void setBusinessRuleProvider(BusinessRuleProvider provider) {
- BusinessRuleProviderFactory.provider = provider;
- }
-
- private void loadProvider() throws CheckedDroolsException {
- ServiceRegistryImpl.getInstance().addDefault( BusinessRuleProvider.class,
- "org.drools.ide.common.BusinessRuleProviderDefaultImpl" );
- setBusinessRuleProvider( ServiceRegistryImpl.getInstance().get( BusinessRuleProvider.class ) );
- }
-
-}
View
17 drools-compiler/src/main/java/org/drools/compiler/compiler/CompositeKnowledgeBuilderImpl.java
@@ -343,23 +343,6 @@ private void buildTypeDeclarations(Collection<CompositePackageDescr> packages) {
}
}
- resourcesByType = this.resourcesByType.remove(ResourceType.BRL);
- if (resourcesByType != null) {
- for (ResourceDescr resourceDescr : resourcesByType) {
- try {
- registerPackageDescr(packages, resourceDescr.resource, pkgBuilder.brlToPackageDescr(resourceDescr.resource));
- } catch (RuntimeException e) {
- if (buildException == null) {
- buildException = e;
- }
- } catch (Exception e) {
- if (buildException == null) {
- buildException = new RuntimeException( e );
- }
- }
- }
- }
-
resourcesByType = this.resourcesByType.remove(ResourceType.DTABLE);
if (resourcesByType != null) {
for (ResourceDescr resourceDescr : resourcesByType) {
View
37 drools-compiler/src/main/java/org/drools/compiler/compiler/PackageBuilder.java
@@ -596,41 +596,6 @@ PackageDescr dslrToPackageDescr(Resource resource) throws DroolsParserException
return hasErrors ? null : pkg;
}
- public void addPackageFromBrl( final Resource resource ) throws DroolsParserException {
- this.resource = resource;
- try {
- addPackage( brlToPackageDescr(resource) );
- } catch (Exception e) {
- throw new DroolsParserException( e );
- } finally {
- this.resource = null;
- }
- }
-
- PackageDescr brlToPackageDescr(Resource resource) throws Exception {
- BusinessRuleProvider provider = BusinessRuleProviderFactory.getInstance().getProvider();
- Reader knowledge = provider.getKnowledgeReader( resource );
-
- DrlParser parser = new DrlParser(configuration.getLanguageLevel());
-
- if (provider.hasDSLSentences()) {
- DefaultExpander expander = getDslExpander();
-
- if (null != expander) {
- knowledge = new StringReader( expander.expand( knowledge ) );
- if (expander.hasErrors())
- this.results.addAll( expander.getErrors() );
- }
- }
-
- PackageDescr pkg = parser.parse( knowledge );
- if (parser.hasErrors()) {
- this.results.addAll( parser.getErrors() );
- return null;
- }
- return pkg;
- }
-
public void addDsl( Resource resource ) throws IOException {
this.resource = resource;
DSLTokenizedMappingFile file = new DSLTokenizedMappingFile();
@@ -703,8 +668,6 @@ public void addKnowledgeResource( Resource resource,
addDsl( resource );
} else if (ResourceType.XDRL.equals( type )) {
addPackageFromXml( resource );
- } else if (ResourceType.BRL.equals( type )) {
- addPackageFromBrl( resource );
} else if (ResourceType.DRF.equals( type )) {
addProcessFromXml( resource );
} else if (ResourceType.BPMN2.equals( type )) {
Please sign in to comment.
Something went wrong with that request. Please try again.