@Override
  protected void setup() {
    super.setup();

    // Set non-standard archive scheme called “wsjar"
    System.setProperty("org.eclipse.emf.common.util.URI.archiveSchemes", "wsjar wszip jar zip");

    log.info("Agent " + getLocalName() + " - starting...");

    // Get agent arguments
    Object[] args = getArguments();
    for (int i = 0; i < args.length; i++) {
      log.info("arg[" + i + "]" + args[i]);
    }

    // Verify if config file is passed as first agent parameter
    String confFile = null;
    if (args.length >= 1 && !("".equals(args[0]))) {
      confFile = (String) args[0];
    }

    // Init agent configuration
    WSIGConfiguration.init(confFile);

    // Verify if wsdlDirectory is passed as second agent parameter
    if (args.length >= 2 && !("".equals(args[1]))) {
      String wsdlDirectory = (String) args[1];
      WSIGConfiguration.getInstance().setWsdlDirectory(wsdlDirectory);
    }

    // Verify if wsigStore is passed as third agent parameter
    if (args.length >= 3 && (args[2] instanceof WSIGStore)) {
      wsigStore = (WSIGStore) args[2];
    }
    if (wsigStore == null) {
      wsigStore = new WSIGStore();
    }

    // Create UDDIManager
    if (WSIGConfiguration.getInstance().isUddiEnable()) {
      uddiManager = new UDDIManager();
    }

    // Register ontology & language
    getContentManager().registerOntology(FIPAManagementOntology.getInstance());
    getContentManager().registerOntology(JADEManagementOntology.getInstance());
    getContentManager().registerLanguage(new SLCodec());

    // Register into a DF
    registerIntoDF();

    // Subscribe to the DF
    DFAgentDescription template = new DFAgentDescription();
    ServiceDescription sd = new ServiceDescription();
    sd.addProperties(new Property(WSIG_FLAG, "true"));
    template.addServices(sd);
    ACLMessage subscriptionMsg =
        DFService.createSubscriptionMessage(this, getDefaultDF(), template, null);
    addBehaviour(
        new SubscriptionInitiator(this, subscriptionMsg) {

          @Override
          protected void handleInform(ACLMessage inform) {
            log.debug(
                "Agent "
                    + getLocalName()
                    + " - Notification received from DF ("
                    + inform.getContent()
                    + ")");
            try {
              DFAgentDescription[] dfds = DFService.decodeNotification(inform.getContent());
              for (DFAgentDescription dfd : dfds) {
                Iterator services = dfd.getAllServices();
                if (services.hasNext()) {
                  // Registration of an agent
                  registerAgent(dfd);
                } else {
                  // Deregistration of an agent
                  deregisterAgent(dfd);
                }
              }
            } catch (Exception e) {
              log.warn(
                  "Agent " + myAgent.getLocalName() + " - Error processing DF notification", e);
            }
          }
        });

    log.info("Agent " + getLocalName() + " - started!");
  }