public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException { String name = args[0].val(); String channel = args[1].val(); NodePoint node; try { node = Tracking.getSub(name); } catch (InvalidNameException ex) { throw new ConfigRuntimeException( "Invalid name " + name + " given to comm_subscribe!", Exceptions.ExceptionType.FormatException, t); } if (node == null) { throw new ConfigRuntimeException( "Unknown SUB " + name + " given to comm_subscribe!", Exceptions.ExceptionType.NotFoundException, t); } try { ((Subscriber) node).subscribe(channel); } catch (InvalidChannelException ex) { throw new ConfigRuntimeException( "Invalid channel " + channel + " given to comm_subscribe!", Exceptions.ExceptionType.FormatException, t); } catch (ZMQException e) { throw new ConfigRuntimeException( "Exception while subscribing: " + e.getMessage(), Exceptions.ExceptionType.IOException, t); } return CNull.NULL; }