/** * Load the parsed and compiled BPEL process definition. */ private CBPInfo loadCBPInfo(File f) { InputStream is = null; try { is = new FileInputStream(f); Serializer ofh = new Serializer(is); CBPInfo info = new CBPInfo(ofh.type, ofh.guid, f); return info; } catch (Exception e) { throw new ContextException("Couldn't read compiled BPEL process " + f.getAbsolutePath(), e); } finally { try { if (is != null) { is.close(); } } catch (Exception e) { ; } } }
public String getBpelDocument() { DeploymentUnitDir.CBPInfo cbpInfo = du.getCBPInfo(getType()); if (cbpInfo == null) { throw new ContextException("CBP record not found for type " + getType()); } try { String relative = getRelativePath(du.getDeployDir(), cbpInfo.getCbp()). replaceAll("\\\\", "/"); if (!relative.endsWith(BPELConstants.BPEL_COMPILED_FILE_EXTENSION)) { throw new ContextException("CBP file must end with " + BPELConstants.BPEL_COMPILED_FILE_EXTENSION + " suffix: " + cbpInfo.getCbp()); } relative = relative.replace(BPELConstants.BPEL_COMPILED_FILE_EXTENSION, BPELConstants.BPEL_FILE_EXTENSION); File bpelFile = new File(du.getDeployDir(), relative); if (!bpelFile.exists()) { log.warn("BPEL file does not exist: " + bpelFile); } return relative; } catch (IOException e) { throw new ContextException("IOException in getBpelRelativePath: " + cbpInfo.getCbp(), e); } }
/** * Load the parsed and compiled BPEL process definition. */ private CBPInfo loadCBPInfo(File f) { InputStream is = null; try { is = new FileInputStream(f); Serializer ofh = new Serializer(is); CBPInfo info = new CBPInfo(ofh.type, ofh.guid, f); return info; } catch (Exception e) { throw new ContextException("Couldn't read compiled BPEL process " + f.getAbsolutePath(), e); } finally { try { if (is != null) is.close(); } catch (Exception e) { ; } } }
public long getCBPFileSize() { DeploymentUnitDir.CBPInfo cbpInfo = du.getCBPInfo(getType()); if (cbpInfo == null) { throw new ContextException("CBP record not found for type " + getType()); } return cbpInfo.getCbp().length(); }
public InputStream getCBPInputStream() { DeploymentUnitDir.CBPInfo cbpInfo = du.getCBPInfo(getType()); if (cbpInfo == null) { throw new ContextException("CBP record not found for type " + getType()); } try { return new FileInputStream(cbpInfo.getCbp()); } catch (FileNotFoundException e) { throw new ContextException("File Not Found: " + cbpInfo.getCbp(), e); } }