org.apache.tuscany.sca.monitor.Monitor.getMessageString()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(12.9k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中org.apache.tuscany.sca.monitor.Monitor.getMessageString()方法的一些代码示例,展示了Monitor.getMessageString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Monitor.getMessageString()方法的具体详情如下:
包路径:org.apache.tuscany.sca.monitor.Monitor
类名称:Monitor
方法名:getMessageString

Monitor.getMessageString介绍

[英]Helper method to retrieve a localized message from a given bundle with a given message ID string
[中]Helper方法从具有给定消息ID字符串的给定捆绑包中检索本地化消息

代码示例

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

public void resolve(Composite composite, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException {
  try {
    if (composite != null)
      extensionProcessor.resolve(composite, resolver, context);
  } catch (Throwable e ) {
    // Add information about which composite was being processed when the exception occurred
    String newMessage = context.getMonitor().getMessageString(CompositeDocumentProcessor.class.getName(),
                                 Messages.RESOURCE_BUNDLE, 
                                 "ProcessingComposite") +
              " " +
              composite.getName() + ": " + e.getMessage();
    throw new ContributionResolveException( newMessage, e );
  } // end try
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-assembly-xml

public void resolve(Composite composite, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException {
  try {
    if (composite != null)
      extensionProcessor.resolve(composite, resolver, context);
  } catch (Throwable e ) {
    // Add information about which composite was being processed when the exception occurred
    String newMessage = context.getMonitor().getMessageString(CompositeDocumentProcessor.class.getName(),
                                 Messages.RESOURCE_BUNDLE, 
                                 "ProcessingComposite") +
              " " +
              composite.getName() + ": " + e.getMessage();
    throw new ContributionResolveException( newMessage, e );
  } // end try
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

/**
 * Reads the contents of a Composite document and returns a Composite object
 * @param contributionURL - the URL of the contribution containing the Composite - can be null
 * @param uri - the URI of the composite document
 * @param url - the URL of the composite document
 * @return a Composite object built from the supplied Composite document
 */
public Composite read(URL contributionURL, URI uri, URL url, ProcessorContext context) throws ContributionReadException {
  if( uri == null || url == null ) {
    throw new ContributionReadException(context.getMonitor().getMessageString(CompositeDocumentProcessor.class.getName(),
                                         Messages.RESOURCE_BUNDLE, 
                                         "NullURL"));
  } // end if
  InputStream scdlStream = null;
  
  try {
    scdlStream = IOHelper.openStream(url);
  } catch (IOException e) {
    ContributionReadException ce = new ContributionReadException(context.getMonitor().getMessageString(CompositeDocumentProcessor.class.getName(),
                                                      Messages.RESOURCE_BUNDLE, 
                                                      "ReadException") + 
                                   " " + 
                                   uri, e);
    error(context.getMonitor(), "ContributionReadException", url, ce);
    throw ce;
  } 
  return read(uri, url, scdlStream, context);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-assembly-xml

/**
 * Reads the contents of a Composite document and returns a Composite object
 * @param contributionURL - the URL of the contribution containing the Composite - can be null
 * @param uri - the URI of the composite document
 * @param url - the URL of the composite document
 * @return a Composite object built from the supplied Composite document
 */
public Composite read(URL contributionURL, URI uri, URL url, ProcessorContext context) throws ContributionReadException {
  if( uri == null || url == null ) {
    throw new ContributionReadException(context.getMonitor().getMessageString(CompositeDocumentProcessor.class.getName(),
                                         Messages.RESOURCE_BUNDLE, 
                                         "NullURL"));
  } // end if
  InputStream scdlStream = null;
  
  try {
    scdlStream = IOHelper.openStream(url);
  } catch (IOException e) {
    ContributionReadException ce = new ContributionReadException(context.getMonitor().getMessageString(CompositeDocumentProcessor.class.getName(),
                                                      Messages.RESOURCE_BUNDLE, 
                                                      "ReadException") + 
                                   " " + 
                                   uri, e);
    error(context.getMonitor(), "ContributionReadException", url, ce);
    throw ce;
  } 
  return read(uri, url, scdlStream, context);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-assembly-xml

ContributionReadException ce = new ContributionReadException(context.getMonitor().getMessageString(CompositeDocumentProcessor.class.getName(),
                                                  Messages.RESOURCE_BUNDLE, 
                                                  "ReadException") +

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

ContributionReadException ce = new ContributionReadException(context.getMonitor().getMessageString(CompositeDocumentProcessor.class.getName(),
                                                  Messages.RESOURCE_BUNDLE, 
                                                  "ReadException") +

代码示例来源:origin: org.apache.tuscany.sca/tuscany-interface-java

public void resolve(JavaInterfaceContract javaInterfaceContract, ModelResolver resolver, ProcessorContext context)
  throws ContributionResolveException {
  try {
    Monitor monitor = context.getMonitor();
    // Resolve the interface and callback interface
    JavaInterface javaInterface =
      resolveJavaInterface((JavaInterface)javaInterfaceContract.getInterface(), resolver, context);
    javaInterfaceContract.setInterface(javaInterface);
    JavaInterface javaCallbackInterface =
      resolveJavaInterface((JavaInterface)javaInterfaceContract.getCallbackInterface(), resolver, context);
    javaInterfaceContract.setCallbackInterface(javaCallbackInterface);
    
    postJAXWSProcessorResolve(javaInterfaceContract, resolver, context);
    
    checkForbiddenAnnotations(monitor, javaInterfaceContract);
    
  } catch (Exception e) {
    throw new ContributionResolveException(context.getMonitor().getMessageString(JavaInterfaceProcessor.class.getName(),
                                           "interface-javaxml-validation-messages",
                                           "ResolvingInterface") + 
                        " " +
                        javaInterfaceContract.getInterface().toString(), e);
  } // end try
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

public void resolve(JavaInterfaceContract javaInterfaceContract, ModelResolver resolver, ProcessorContext context)
  throws ContributionResolveException {
  try {
    Monitor monitor = context.getMonitor();
    // Resolve the interface and callback interface
    JavaInterface javaInterface =
      resolveJavaInterface((JavaInterface)javaInterfaceContract.getInterface(), resolver, context);
    javaInterfaceContract.setInterface(javaInterface);
    JavaInterface javaCallbackInterface =
      resolveJavaInterface((JavaInterface)javaInterfaceContract.getCallbackInterface(), resolver, context);
    javaInterfaceContract.setCallbackInterface(javaCallbackInterface);
    
    postJAXWSProcessorResolve(javaInterfaceContract, resolver, context);
    
    checkForbiddenAnnotations(monitor, javaInterfaceContract);
    
  } catch (Exception e) {
    throw new ContributionResolveException(context.getMonitor().getMessageString(JavaInterfaceProcessor.class.getName(),
                                           "interface-javaxml-validation-messages",
                                           "ResolvingInterface") + 
                        " " +
                        javaInterfaceContract.getInterface().toString(), e);
  } // end try
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-interface-wsdl

resolver.addModel(wsdlInterface, context);
  } catch (InvalidInterfaceException e) {
    String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(),
                                "interface-wsdlxml-validation-messages", 
                                "InvalidInterface");
String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(),
                            "interface-wsdlxml-validation-messages", 
                            "WSDLDefinitionUnresolved");

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

resolver.addModel(wsdlInterface, context);
  } catch (InvalidInterfaceException e) {
    String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(),
                                "interface-wsdlxml-validation-messages", 
                                "InvalidInterface");
String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(),
                            "interface-wsdlxml-validation-messages", 
                            "WSDLDefinitionUnresolved");

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

String message = context.getMonitor().getMessageString(JavaImplementationProcessor.class.getName(),
                            "impl-javaxml-validation-messages", 
                            "ResolvingJavaImplementation");

代码示例来源:origin: org.apache.tuscany.sca/tuscany-contribution

String message = context.getMonitor().getMessageString(ContributionContentProcessor.class.getName(),
                            "contribution-xml-validation-messages", 
                            "ExportedPackageNotFound");

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

String message = context.getMonitor().getMessageString(ContributionContentProcessor.class.getName(),
                            "contribution-xml-validation-messages", 
                            "ExportedPackageNotFound");

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

ContributionResolveException ce = new ContributionResolveException(context.getMonitor().getMessageString(JavaInterfaceProcessor.class.getName(),
                                                       "interface-javaxml-validation-messages", 
                                                       "ResolvingInterface") + 
  return javaInterface;
} catch ( Exception e ) {
  throw new ContributionResolveException(context.getMonitor().getMessageString(JavaInterfaceProcessor.class.getName(),
                                         "interface-javaxml-validation-messages", 
                                         "ResolvingInterface") +

代码示例来源:origin: org.apache.tuscany.sca/tuscany-interface-wsdl

wsdlInterface = newWSDLInterface;
  } catch (InvalidInterfaceException e) {
    String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(),
                                "interface-wsdlxml-validation-messages", 
                                "InvalidInterface");
String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(),
                            "interface-wsdlxml-validation-messages", 
                            "WSDLDefinitionUnresolved");

代码示例来源:origin: org.apache.tuscany.sca/tuscany-interface-java

ContributionResolveException ce = new ContributionResolveException(context.getMonitor().getMessageString(JavaInterfaceProcessor.class.getName(),
                                                       "interface-javaxml-validation-messages", 
                                                       "ResolvingInterface") + 
  return javaInterface;
} catch ( Exception e ) {
  throw new ContributionResolveException(context.getMonitor().getMessageString(JavaInterfaceProcessor.class.getName(),
                                         "interface-javaxml-validation-messages", 
                                         "ResolvingInterface") +

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

wsdlInterface = newWSDLInterface;
  } catch (InvalidInterfaceException e) {
    String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(),
                                "interface-wsdlxml-validation-messages", 
                                "InvalidInterface");
String message = context.getMonitor().getMessageString(WSDLInterfaceProcessor.class.getName(),
                            "interface-wsdlxml-validation-messages", 
                            "WSDLDefinitionUnresolved");

代码示例来源:origin: org.apache.tuscany.sca/tuscany-assembly-xml

composite.getIncludes().set(i, resolved);
} else {
  String message = context.getMonitor().getMessageString(CompositeProcessor.class.getName(),
                              Messages.RESOURCE_BUNDLE, 
                              "LocalAttibuteMissmatch");
String message = context.getMonitor().getMessageString(CompositeProcessor.class.getName(),
                            Messages.RESOURCE_BUNDLE, 
                            "CompositeNotFound");

代码示例来源:origin: org.apache.tuscany.sca/tuscany-assembly-xml

/**
 * Reads an abstract property element.
 * @param property
 * @param reader
 * @param context TODO
 * @throws XMLStreamException
 * @throws ContributionReadException
 */
protected void readAbstractProperty(AbstractProperty property, XMLStreamReader reader, ProcessorContext context) throws XMLStreamException,
  ContributionReadException {
  property.setName(getString(reader, NAME));
  property.setMany(getBoolean(reader, MANY));
  property.setMustSupply(getBoolean(reader, MUST_SUPPLY));
  property.setXSDElement(getQName(reader, ELEMENT));
  property.setXSDType(getQName(reader, TYPE));
  // MJE added 14/05/2009 - check for both @element and @type being present - disallowed by OASIS Assembly spec
  if( property.getXSDElement() != null && property.getXSDType() != null ) {
    // TUSCANY-4020 - should get rid of the exception but that would mean getting OASIS to change the 
    //                expected strings again
    ContributionReadException ce = new ContributionReadException(context.getMonitor().getMessageString(BaseAssemblyProcessor.class.getName(),
                                                      Messages.RESOURCE_BUNDLE, 
                                                      "BothTypeAndElementAttributeFound") + 
                                   " - " + 
                                   property.getName());
    error(context.getMonitor(), "ContributionReadException", property, ce);
  } // end if
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

/**
 * Reads an abstract property element.
 * @param property
 * @param reader
 * @param context TODO
 * @throws XMLStreamException
 * @throws ContributionReadException
 */
protected void readAbstractProperty(AbstractProperty property, XMLStreamReader reader, ProcessorContext context) throws XMLStreamException,
  ContributionReadException {
  property.setName(getString(reader, NAME));
  property.setMany(getBoolean(reader, MANY));
  property.setMustSupply(getBoolean(reader, MUST_SUPPLY));
  property.setXSDElement(getQName(reader, ELEMENT));
  property.setXSDType(getQName(reader, TYPE));
  // MJE added 14/05/2009 - check for both @element and @type being present - disallowed by OASIS Assembly spec
  if( property.getXSDElement() != null && property.getXSDType() != null ) {
    // TUSCANY-4020 - should get rid of the exception but that would mean getting OASIS to change the 
    //                expected strings again
    ContributionReadException ce = new ContributionReadException(context.getMonitor().getMessageString(BaseAssemblyProcessor.class.getName(),
                                                      Messages.RESOURCE_BUNDLE, 
                                                      "BothTypeAndElementAttributeFound") + 
                                   " - " + 
                                   property.getName());
    error(context.getMonitor(), "ContributionReadException", property, ce);
  } // end if
}

相关文章