[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xmlblaster] Socket protocol and plugin info

Hi folks.

While around with the socket protocol, I have come across the
SocketConnection.init(Global, PluginInfo) method which is laid out as

  public void init(org.xmlBlaster.util.Global glob, PluginInfo
pluginInfo) throws XmlBlasterException 
      this.glob = (glob == null) ? Global.instance() : glob;

      this.pluginInfo = pluginInfo;
      String tmp =
      this.useUdpForOneway = Boolean.valueOf(tmp).booleanValue();
      if (log.isLoggable(Level.FINER)) log.finer("Entering
      // Put this instance in the NameService, will be looked up by
nnection", this);

The difficult part is if not relying on a XmlBlasterAccess object but
directly working with the SocketConnection class.
In this case there is no PluginInfo object which leads to a
NullPointerException when fetching the useUdpForOneWay parameter.
I believe someone has already thought about this scenario because
getVersion handles a non-existent PluginInfo:

   public String getVersion() 
      return (this.pluginInfo == null) ? "1.0" :

So that looks somehow like a bug. One solution could be to move the
useUdpForOneway property into Global, the other to catch this faulty
condition by testing the PluginInfo object for null reference.

Any comments ?

Best regards,