Package net.sf.xbus.base.core

Examples of net.sf.xbus.base.core.XException


    {
      inStream.close();
    }
    catch (IOException e)
    {
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_TECHNICAL,
          Constants.PACKAGE_TECHNICAL_HTTP, "0", e);
    }
    return null;
  }
View Full Code Here


      if (((statusCode < 200) || statusCode > 299) && (!isSOAPMessage()))
      {
        List params = new Vector();
        params.add(String.valueOf(statusCode));
        throw new XException(Constants.LOCATION_EXTERN,
            Constants.LAYER_TECHNICAL,
            Constants.PACKAGE_TECHNICAL_HTTP, "1", params);
      }
    }
    catch (HttpException e)
    {
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_TECHNICAL,
          Constants.PACKAGE_TECHNICAL_HTTP, "0", e);
    }
    catch (IOException e)
    {
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_TECHNICAL,
          Constants.PACKAGE_TECHNICAL_HTTP, "0", e);
    }
    return response;
  }
View Full Code Here

                    "Keystore"));
      }
    }
    catch (MalformedURLException e)
    {
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_TECHNICAL,
          Constants.PACKAGE_TECHNICAL_HTTP, "0", e);
    }
  }
View Full Code Here

       * Check if ReceiverThread isn't already running
       */
      if (getRunningReceiverThreads().contains(system)) {
        Vector params = new Vector(1);
        params.add(system);
        throw new XException(Constants.LOCATION_INTERN,
            Constants.LAYER_TECHNICAL,
            Constants.PACKAGE_TECHNICAL_TECHNICAL, "7", params);
      }

      /*
       * Start receiver
       */
      ReceiverThreadBase receiverThreadImpl = ReceiverFactory
          .createReceiverThread(receiver, system);

      Thread receiverThread = new Thread(mThreadGroup,
          receiverThreadImpl, system);
      receiverThread.setDaemon(false);
      receiverThread
          .setContextClassLoader(XBUSClassLoader.getInstance(Thread
              .currentThread().getContextClassLoader()));
      receiverThread.start();

      /*
       * Put system and thread in list of all systems and remove it from
       * stoppedThreads
       */
      mAllThreads.put(system, receiverThreadImpl);
      mStoppedThreads.remove(system);
    } else if (isHTTPReceiver(system)) {
      if (mStoppedHTTPReceivers.contains(system)) {
        mStoppedHTTPReceivers.remove(system);
        Trace.always("Starting HTTPReceiver for " + system);
      }
    } else {
      Vector params = new Vector(1);
      params.add(system);
      throw new XException(Constants.LOCATION_INTERN,
          Constants.LAYER_TECHNICAL,
          Constants.PACKAGE_TECHNICAL_TECHNICAL, "6", params);
    }

  }
View Full Code Here

    {
      retObject = tc.call();
    }
    catch (Exception e)
    {
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_TECHNICAL,
          Constants.PACKAGE_TECHNICAL_JAVA, "0", e);
    }

    return retObject;
View Full Code Here

    {
      line = readLine();
    }
    catch (IOException e)
    {
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_TECHNICAL,
          Constants.PACKAGE_TECHNICAL_FILE, "0", e);
    }

    if ((mTransformer != null) && (line != null))
View Full Code Here

    {
      close();
    }
    catch (IOException e)
    {
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_TECHNICAL,
          Constants.PACKAGE_TECHNICAL_FILE, "0", e);
    }
  }
View Full Code Here

        break;
      }
    }
    if (function == null)
    {
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_PROTOCOL, Constants.PACKAGE_PROTOCOL_SOAP,
          "1");
    }
    setFunction(function.getLocalName());
  }
View Full Code Here

    NodeList bodyList = doc.getElementsByTagNameNS(SOAP_NAMESPACE,
        SOAP_BODY);

    if (bodyList.getLength() == 0)
    {
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_PROTOCOL, Constants.PACKAGE_PROTOCOL_SOAP,
          "2");
    }
    if (bodyList.getLength() > 1)
    {
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_PROTOCOL, Constants.PACKAGE_PROTOCOL_SOAP,
          "3");
    }

    return bodyList.item(0);
View Full Code Here

        fromAddress = new InternetAddress(fromAddressString);
      }
    }
    catch (Exception e)
    {
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_TECHNICAL,
          Constants.PACKAGE_TECHNICAL_MAIL, "0", e);
    }

    mUser = config.getValueOptional(Constants.CHAPTER_SYSTEM, mDestination
        .getName(), "User");
    if (mUser != null)
    {
      mPassword = config.getValue(Constants.CHAPTER_SYSTEM, mDestination
          .getName(), "Password");
    }

    /*
     * Setting the session
     */
    Properties props = new Properties();
    props.put("mail.smtp.host", host);
    if (mUser != null)
    {
      props.put("mail.smtp.auth", "true");
    }
    Authenticator auth = new MyAuthenticator();
    Session session = Session.getInstance(props, auth);
    try
    {
      /*
       * Creating the message
       */
      MimeMessage msg = new MimeMessage(session);
      if (mUser != null)
      {
        msg.setHeader("AUTH", "PLAIN");
      }
      msg.setFrom(fromAddress);
      msg.setRecipients(Message.RecipientType.TO, toAddresses);
      msg.setSubject(subject);
      msg.setSentDate(new Date());
      msg.setText(callData, getEncoding());

      /*
       * Sending the message
       */
      Transport.send(msg);
    }
    catch (Exception e) // (MessagingException e) per casting below
    { // HP Java runtime did not recognise MessagingException as a subtype
      // of
      // Throwable.
      try
      {
        MessagingException me = (MessagingException) e;
        Exception nextException = me.getNextException();
        if (nextException != null)
        {
          Trace.error(nextException.getMessage());
          if (nextException instanceof SendFailedException)
          {
            Address[] invalid = ((SendFailedException) nextException)
                .getInvalidAddresses();
            for (int i = 0; i < invalid.length; i++)
            {
              Trace.error("Invalid address: "
                  + ((InternetAddress) invalid[i])
                      .getAddress());
            }
          }
        }
      }
      catch (ClassCastException ce)
      {}
      throw new XException(Constants.LOCATION_EXTERN,
          Constants.LAYER_TECHNICAL,
          Constants.PACKAGE_TECHNICAL_MAIL, "0", e);
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of net.sf.xbus.base.core.XException

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.