⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 invoicercvr.java

📁 sun公司的petstore,一个J2ee的示例应用程序.
💻 JAVA
字号:
package com.sun.j2ee.blueprints.opc.webservice.invoicercvr;import java.net.*;import java.io.*;import java.rmi.*;import javax.xml.transform.*;import javax.xml.transform.stream.*;import javax.jms.*;import com.sun.j2ee.blueprints.opc.webservice.*;import com.sun.j2ee.blueprints.xmldocuments.XMLDocumentException;import com.sun.j2ee.blueprints.servicelocator.web.ServiceLocator;public class InvoiceRcvr {  public static final boolean TRACE = false;  private TPAInvoiceXDE invoiceXDE;  private TopicHelper invoiceTopicHelper;  public InvoiceRcvr() throws RemoteException {        try {      ServiceLocator serviceLocator = ServiceLocator.getInstance();      TopicConnectionFactory topicFactory = serviceLocator.getTopicConnectionFactory(JNDINames.TOPIC_CONNECTION_FACTORY);      Topic invoiceTopic = serviceLocator.getTopic(JNDINames.INVOICE_TOPIC);      invoiceTopicHelper = new TopicHelper(topicFactory, invoiceTopic);      invoiceXDE = new TPAInvoiceXDE(serviceLocator.getUrl(JNDINames.XML_ENTITY_CATALOG_URL),                                     serviceLocator.getBoolean(JNDINames.XML_VALIDATION_INVOICE),                                     serviceLocator.getBoolean(JNDINames.XML_XSD_VALIDATION));        } catch (Exception exception) {      System.err.println(exception);      throw new RemoteException("Service internal error.", exception);        }        return;  }  public void receive(Source invoiceDocument) throws RemoteException, InvalidInvoiceException {        try {      invoiceXDE.setDocument(invoiceDocument);      String document = invoiceXDE.getDocumentAsString();      if (TRACE) {                System.err.println("InvoiceRcvr.receive, resending: " + document);      }      invoiceTopicHelper.sendMessage(document);        } catch (XMLDocumentException exception) {      System.err.println(exception);      throw new InvalidInvoiceException(exception.getMessage());        } catch (Exception exception) {      System.err.println(exception);      throw new RemoteException("Service internal error.", exception);        }        return;  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -