Package org.apache.uima.aae.error

Examples of org.apache.uima.aae.error.AsynchAEException


          UimaMessage message = getTransport(delegateEndpoints[i].getEndpoint()).produceMessage(
                  AsynchAEMessage.GetMeta, AsynchAEMessage.Request, getName());
          UimaTransport transport = getTransport(delegateEndpoints[i].getEndpoint());
          transport.getUimaMessageDispatcher(delegateEndpoints[i].getEndpoint()).dispatch(message);
        } catch (Exception e) {
          throw new AsynchAEException(e);
        }
      }
    }
  }
View Full Code Here


            }
          }
        }
      }
    } catch (Exception e) {
      throw new AsynchAEException(e);
    }
  }
View Full Code Here

  public void dispatchMetadataRequest(Endpoint anEndpoint) throws AsynchAEException {
    if (isStopped()) {
      return;
    }
    if (anEndpoint == null) {
      throw new AsynchAEException("Controller:" + getComponentName()
              + " Unable To Dispatch GetMeta Request. Provided Endpoint is Invalid (NULL)");
    }
    anEndpoint.setController(this);
    anEndpoint.setWaitingForResponse(true);
    String key = lookUpDelegateKey(anEndpoint.getEndpoint());
View Full Code Here

        invokeProcess(cas, casReferenceId, null, aMessageContext, newCASProducedBy);
      }
    } catch (AsynchAEException e) {
      throw e;
    } catch (Exception e) {
      throw new AsynchAEException(e);
    }

  }
View Full Code Here

      }

    } catch (AsynchAEException e) {
      throw e;
    } catch (Exception e) {
      throw new AsynchAEException(e);
    }

  }
View Full Code Here

            if (e instanceof JMSException) {
              rethrow = handleJmsException((JMSException) e);

            }
            if (rethrow) {
              throw new AsynchAEException(e);
            }
          }
     
    }
  }
View Full Code Here

  }

  public TextMessage produceTextMessage(String aTextMessage) throws AsynchAEException {
  synchronized( lock ) {
      if ( producerSession == null ) {
          throw new AsynchAEException("Controller:"+controller.getComponentName()+" Unable to create JMS Message. Producer Session Not Initialized (Null)");
        }
        try {
           if (aTextMessage == null) {
              return producerSession.createTextMessage("");
           } else {
              return producerSession.createTextMessage(aTextMessage);
           }
         } catch (javax.jms.IllegalStateException e) {
            try {
              open();
            } catch (ServiceShutdownException ex) {
              if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
                UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                        "produceTextMessage", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                        "UIMAEE_service_exception_WARNING", controller.getComponentName());
               
                UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                        "produceTextMessage", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                        "UIMAJMS_exception__WARNING", ex);
              }
            } catch (AsynchAEException ex) {
              throw ex;
            }
          } catch (Exception e) {
            throw new AsynchAEException(e);
        }
        throw new AsynchAEException(new InvalidMessageException("Unable to produce Message Object"));
  }
  }
View Full Code Here

  }

  public BytesMessage produceByteMessage(byte[] aSerializedCAS) throws AsynchAEException {
    synchronized( lock ) {
        if ( producerSession == null ) {
            throw new AsynchAEException("Controller:"+controller.getComponentName()+" Unable to create JMS Message. Producer Session Not Initialized (Null)");
          }
          int retryCount = 1;
          while (retryCount > 0) {
            try {
              retryCount--;
              BytesMessage bm = producerSession.createBytesMessage();
              bm.writeBytes(aSerializedCAS);

              return bm;

            } catch (javax.jms.IllegalStateException e) {
              try {
                open();
              } catch (ServiceShutdownException ex) {
                if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
                  UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                          "produceByteMessage", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                          "UIMAEE_service_exception_WARNING", controller.getComponentName());
                 
                  UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
                          "produceByteMessage", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                          "UIMAJMS_exception__WARNING", ex);
                }
              }

            } catch (Exception e) {
              throw new AsynchAEException(e);
            }
          }
          throw new AsynchAEException(
                  new InvalidMessageException("Unable to produce BytesMessage Object"));
    }
  }
View Full Code Here

  }

  public ObjectMessage produceObjectMessage() throws AsynchAEException {
    synchronized( lock ) {
      if ( producerSession == null ) {
          throw new AsynchAEException("Controller:"+controller.getComponentName()+" Unable to create JMS Message. Producer Session Not Initialized (Null)");
        }
        try {
          if (!((ActiveMQSession) producerSession).isRunning()) {
            open();
          }
          return producerSession.createObjectMessage();
        } catch (Exception e) {
          throw new AsynchAEException(e);
        }
    }
  }
View Full Code Here

  public synchronized CacheEntry getCacheEntryForCAS(String aCasReferenceId)
          throws AsynchAEException {
    CacheEntry casRefEntry = getEntry(aCasReferenceId);
    if (casRefEntry == null) {
      throw new AsynchAEException("Cas Not Found In CasManager Cache. CasReferenceId::"
              + aCasReferenceId + " is Invalid");
    }
    return casRefEntry;
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.aae.error.AsynchAEException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.