1 Reply Latest reply on Aug 4, 2006 11:09 AM by one_special_user

    Accessing serial ports from jboss

    meme

      Hi,

      I've got the need for an component wich accesses the serial port, aquiring data from this port. The standard-beans (such as Stateless or Stateful Session beans are not possible)

      So wich is the best approach to access the serial-port from jboss to get these data?

      The data should be collected from the serial and provided to the running services via JMS.

      me

        • 1. Re: Accessing serial ports from jboss

          OK, this post is a little old :-)
          Have a look at JNI (Java Native Interfaces), since you want do do some platform-specific stuff.
          Write a Shared Library (*.so / *.dll) with apropriate Method-Names and use it:

          public class XY {
          
           static {
           System.loadLibrary( "MyLibrary" );
           }
          
           public native byte[] getBytes() throws SomeException;
          
          }


          But I'm not sure if the specs allow an EJB to load Libraries... if not - write a standalone - app which subscribes to your Queue/Topic.