/*
There are no capabilities registered for the following addresses, so this is an emulation
unfortunately, there is no capability-reference also, so, each attribute that wants to have
the auto-complete, must add the SuggestionResource as a factory.
13499
private void registerManualCapabilities() {

        capabilities.register(EJB_CACHE, true,
                AddressTemplate.of("/{selected.profile}/subsystem=ejb3/cache=*"));

        capabilities.register(EJB_PASSIVATION_STORE, true,
                AddressTemplate.of("/{selected.profile}/subsystem=ejb3/passivation-store=*"));

        capabilities.register(EJB_THREAD_POOL, true,
                AddressTemplate.of("/{selected.profile}/subsystem=ejb3/thread-pool=*"));

        capabilities.register(LOGGING_FORMATTER, true,
                AddressTemplate.of("/{selected.profile}/subsystem=logging/pattern-formatter=*"),
                AddressTemplate.of("/{selected.profile}/subsystem=logging/custom-formatter=*"));

        capabilities.register(MESSAGING_QUEUES, true,
                AddressTemplate.of("/{selected.profile}/subsystem=messaging-activemq/server=*/jms-queue=*"),
                AddressTemplate.of("/{selected.profile}/subsystem=messaging-activemq/server=*/jms-topic=*"));

        capabilities.register(STATELESS_SESSION_BEAN_POOL, true,
                AddressTemplate.of("/{selected.profile}/subsystem=ejb3/strict-max-bean-instance-pool=*"));

        capabilities.register(UNDERTOW_RESPONSE_FILTER, true,
                AddressTemplate.of("/{selected.profile}/subsystem=undertow/configuration=filter/response-header=*"));

    }
680456
@Override
    public T addAsWebInfResource(final Asset resource, final ArchivePath target) throws IllegalArgumentException {
        Validate.notNull(resource, "Resource should be specified");
        Validate.notNull(target, "Target should be specified");

        final ArchivePath location = new BasicPath(getWebInfPath(), target);
        return add(resource, location);
    }
1225543
public static NewAppiumSessionPayload create(Capabilities caps) throws IOException {
        boolean forceMobileJSONWP =
                ofNullable(caps.getCapability(FORCE_MJSONWP))
                .map(o -> Boolean.class.isAssignableFrom(o.getClass()) && Boolean.class.cast(o))
                .orElse(false);

        HashMap<String, ?> capabilityMap = new HashMap<>(caps.asMap());
        capabilityMap.remove(FORCE_MJSONWP);
        Map<String, ?> source = of(DESIRED_CAPABILITIES, capabilityMap);
        String json = new Json().toJson(source);
        return new NewAppiumSessionPayload(new StringReader(json), forceMobileJSONWP);
    }
1283773
protected void onAddressChange(SuggestOracle.Suggestion suggestion) {

        try {
            onAddressChange(suggestion.getDisplayString());
        } catch (Throwable t) {
            CmsErrorDialog.handleException(t);
        }
    }
25534
@Override
    public ResourceReferenceFactory<Object> registerResourceInjectionPoint(final InjectionPoint injectionPoint) {
        return new ResourceReferenceFactory<Object>() {
            @Override
            public ResourceReference<Object> createResource() {
                return new SimpleResourceReference<Object>(resolveResource(injectionPoint));
            }
        };
    }
990771
public void addTangoAttConfigListener(ITangoAttConfigListener listener, String attrName, String[] filters, boolean stateless)
            throws DevFailed {
        TangoAttConfig tangoAttConfig;
        String key = deviceName+"/"+attrName;
        if ((tangoAttConfig = tango_att_config_source.get(key)) == null) {
            tangoAttConfig = new TangoAttConfig(deviceProxy, attrName, filters);
            tango_att_config_source.put(key, tangoAttConfig);
        }

        synchronized (moni) {
            tangoAttConfig.addTangoAttConfigListener(listener, stateless);
        }
    }
1122380
public static ModelNode createWriteAttributeOperation(PathAddress address, String name, ModelNode value) {
        ModelNode operation = createAttributeOperation(ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION, address, name);
        operation.get(ModelDescriptionConstants.VALUE).set(value);
        return operation;
    }
119850
function HtmlUnitDriver(
  desiredCapabilitiesOrEnableJavascript
  ) {
  var instance;
  var first = desiredCapabilitiesOrEnableJavascript;
  var len = arguments.length;

  if (!len) {
    instance = new Class();
  } else if (len === 1) {
    if (assert(first).extends(Capabilities).isValid) {
      instance = new Class(first._instance);
    } else if (assert.isBool(first)) {
      instance = new Class(first);
    } else {
      throw new Error(
        'The first argument must be an instance of Capabilities or a boolean.'
       );
    }
  } else {
    throw new Error('The wrong number of arguments was given.');
  }

  addFinalProp(this, '_instance', instance);
}
876702
@Override
    public Object createResource(final ResourceInfo resInfo) throws Exception {
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "createResource", resInfo);

        Object connectionFactory;

        lock.readLock().lock();
        try {
            if (!isInitialized.get()) {
                // Switch to write lock for lazy initialization
                lock.readLock().unlock();
                lock.writeLock().lock();
                try {
                    if (!isInitialized.get())
                        initPrivileged();
                } finally {
                    // Downgrade to read lock for rest of method
                    lock.readLock().lock();
                    lock.writeLock().unlock();
                }
            }
            checkAccess();
            ConnectionManager conMgr = AccessController.doPrivileged(new PrivilegedExceptionAction<ConnectionManager>() {
                @Override
                public ConnectionManager run() throws Exception {
                    return conMgrSvc.getConnectionManager(resInfo, AbstractConnectionFactoryService.this);
                }
            });
            connectionFactory = getManagedConnectionFactory(null).createConnectionFactory(conMgr);
        } catch (Exception x) {
            if (trace && tc.isEntryEnabled())
                Tr.exit(this, tc, "createResource", x);
            throw x;
        } catch (Error x) {
            if (trace && tc.isEntryEnabled())
                Tr.exit(this, tc, "createResource", x);
            throw x;
        } finally {
            lock.readLock().unlock();
        }

        // Only connection factories defined in the server configuration are tracked for the app recycle coordinator.
        if (isServerDefined) {
            ComponentMetaData cData = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
            if (cData != null)
                appsToRecycle.add(cData.getJ2EEName().getApplication());
        }

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "createResource", connectionFactory);
        return connectionFactory;
    }
3439
private static EndpointReferenceType createEPR(Server server, String address, SLProperties props) {
        EndpointReferenceType sourceEPR = server.getEndpoint().getEndpointInfo().getTarget();
        EndpointReferenceType targetEPR = WSAEndpointReferenceUtils.duplicate(sourceEPR);
        WSAEndpointReferenceUtils.setAddress(targetEPR, address);

        if (props != null) {
            addProperties(targetEPR, props);
        }
        return targetEPR;
    }
792200
@Override
    public T addAsWebInfResource(final String resourceName) throws IllegalArgumentException {
        Validate.notNull(resourceName, "ResourceName should be specified");

        return addAsWebInfResource(new ClassLoaderAsset(resourceName),
            AssetUtil.getNameForClassloaderResource(resourceName));
    }
861928
@Override
    public T addAsWebResource(Asset resource, String target) throws IllegalArgumentException {
        Validate.notNull(resource, "Resource should be specified");
        Validate.notNull(target, "Target should be specified");

        return addAsWebResource(resource, new BasicPath(target));
    }
581893
public static void addCompleteJarEntryUrls(List<ContainerInfo> containers, Entry jarEntry, Collection<String> resolved) throws UnableToAdaptException {
        String entryIdentity = createEntryIdentity(jarEntry);
        if (!entryIdentity.isEmpty() && !resolved.contains(entryIdentity)) {
            resolved.add(entryIdentity);
            processMFClasspath(jarEntry, containers, resolved);
        }
    }
52397
private void addAllEntries(Set s, com.ibm.wsspi.adaptable.module.Container dir) throws UnableToAdaptException {
        for(Entry entry : dir){
            String path = entry.getPath();
            com.ibm.wsspi.adaptable.module.Container possibleContainer = entry.adapt(com.ibm.wsspi.adaptable.module.Container.class);
            //If this container appears to be a directory then we need to add / to the path
            //If this container is a nested archive, then we add it as-is.
            if(possibleContainer != null && !possibleContainer.isRoot()) { 
                path = path + "/";
            }
            s.add(path);
        }
    }
435797
public void configure() throws UnableToAdaptException {
        boolean webIsMetadataComplete = isMetadataComplete();
        
        // locate annotations

        // Collapse all of the prior scanner calls into a single step:
        // The resulting merge has obtained target information for all of the
        // target locations, with precedence per the location ordering.
        //
        // What particular targets are obtained is a curious business, as
        // the class selection uses the names of classes in the included
        // location, but obtains the information for each of those classes
        // using the entire class search space.
        
        // Maybe, move this inside the 'isMetadataComplete' test?
        // The web annotations don't seem to be used except when
        // metadata-complete is false.
        
        this.webAnnotations = this.moduleContainer.adapt(WebAnnotations.class);

        if ( !webIsMetadataComplete ) {
            this.webAnnotations.openInfoStore();
        }
        
        try {

            for (ServletConfiguratorHelper configHelper : configHelpers) {
                configHelper.configureInit();
            }

            //process web.xml
            if (webApp != null) {
                this.currentLibraryURI = WebApp.DD_NAME;
                this.currentSource = ConfigSource.WEB_XML;
                this.currentMetadataComplete = isMetadataComplete();

                for (ServletConfiguratorHelper configHelper : configHelpers) {
                    configHelper.configureFromWebApp(webApp);
                }
            }
            
            //process web-fragment.xml
            if (!webIsMetadataComplete) {
                for (WebFragmentInfo webFragmentItem : this.webAnnotations.getOrderedItems()) {
                    WebFragment webFragment = webFragmentItem.getWebFragment();
                    this.currentLibraryURI = webFragmentItem.getLibraryURI();
                    this.currentSource = ConfigSource.WEB_FRAGMENT;
                    this.currentMetadataComplete = webFragment != null && webFragment.isMetadataComplete();
    
                    if (webFragment != null) {
                        for (ServletConfiguratorHelper configHelper : configHelpers) {
                            configHelper.configureFromWebFragment(webFragmentItem);
                        }
                    }
                    
                    if (!currentMetadataComplete) {
                        for (ServletConfiguratorHelper configHelper : configHelpers) {
                            configHelper.configureFromAnnotations(webFragmentItem);
                        }
                    }
                    
                    ((WebAppConfiguratorHelper) webAppHelper).processIgnoredMappings(webApp);
                }
            }

            for (ServletConfiguratorHelper configHelper : configHelpers) {
                configHelper.configureDefaults();
            }
            
        } finally {
            if (!webIsMetadataComplete) {
                this.webAnnotations.closeInfoStore();
            }
        }

        clearContext();

        if (webBnd != null) {
            for (ServletConfiguratorHelper configHelper : configHelpers) {
                configHelper.configureWebBnd(webBnd);
            }
        }

        if (webExt != null) {
            for (ServletConfiguratorHelper configHelper : configHelpers) {
                configHelper.configureWebExt(webExt);
            }
        }

        for (ServletConfiguratorHelper configHelper : configHelpers) {
            configHelper.finish();
        }
        
        if (this.haveAnyErrorMessages()) {
            throw new UnableToAdaptException(this.getErrorMessageText());
        }
    }
1341290
public static base_responses add(nitro_service client, arp resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			arp addresources[] = new arp[resources.length];
			for (int i=0;i<resources.length;i++){
				addresources[i] = new arp();
				addresources[i].ipaddress = resources[i].ipaddress;
				addresources[i].td = resources[i].td;
				addresources[i].mac = resources[i].mac;
				addresources[i].ifnum = resources[i].ifnum;
				addresources[i].ownernode = resources[i].ownernode;
			}
			result = add_bulk_request(client, addresources);
		}
		return result;
	}
206211
@Override
    public T addAsWebInfResource(final Asset resource, final String target) throws IllegalArgumentException {
        Validate.notNull(resource, "Resource should be specified");
        Validate.notNullOrEmpty(target, "Target should be specified");

        return addAsWebInfResource(resource, ArchivePaths.create(target));
    }