org.drools.io
Class ResourceFactory
java.lang.Object
org.drools.io.ResourceFactory
public class ResourceFactory
- extends Object
Convenience Factory to provide Resource implementations for the desired IO resource.
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add( ResourceFactory.newUrlResource( "htp://www.domain.org/myProcess.bpmn2" ),
ResourceType.BPMN2 );
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add( ResourceFactory.newClassPathResource( "htp://www.domain.org/myrules.drl", getClass() ),
ResourceType.DRL );
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResourceFactory
public ResourceFactory()
getResourceChangeNotifierService
public static ResourceChangeNotifier getResourceChangeNotifierService()
- A Service that can be started, to provide notifications of changed Resources.
- Returns:
getResourceChangeScannerService
public static ResourceChangeScanner getResourceChangeScannerService()
- As service, that scans the disk for changes, this acts as a Monitor for the Notifer service.
- Returns:
newUrlResource
public static Resource newUrlResource(URL url)
newUrlResource
public static Resource newUrlResource(String path)
newFileResource
public static Resource newFileResource(File file)
newFileResource
public static Resource newFileResource(String fileName)
newByteArrayResource
public static Resource newByteArrayResource(byte[] bytes)
newInputStreamResource
public static Resource newInputStreamResource(InputStream stream)
newReaderResource
public static Resource newReaderResource(Reader reader)
newReaderResource
public static Resource newReaderResource(Reader reader,
String encoding)
newClassPathResource
public static Resource newClassPathResource(String path)
newClassPathResource
public static Resource newClassPathResource(String path,
Class clazz)
newClassPathResource
public static Resource newClassPathResource(String path,
ClassLoader classLoader)
newDescrResource
public static Resource newDescrResource(KnowledgeDescr descr)
Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.