Initialize the SARL capacity type.

@param source the source.
@param inferredJvmType the JVM type.
320036
protected void initialize(SarlCapacity source, JvmGenericType inferredJvmType) {
		// Issue #356: do not generate if the capacity has no name.
		assert source != null;
		assert inferredJvmType != null;
		if (Strings.isNullOrEmpty(source.getName())) {
			return;
		}
		// Create the generation context that is used by the other transformation functions.
		final GenerationContext context = openContext(source, inferredJvmType,
				Collections.singleton(SarlAction.class));
		try {
			// Copy the documentation
			this.typeBuilder.copyDocumentationTo(source, inferredJvmType);

			// Change the modifiers on the generated type.
			inferredJvmType.setInterface(true);
			inferredJvmType.setAbstract(true);
			setVisibility(inferredJvmType, source);
			inferredJvmType.setStatic(false);
			inferredJvmType.setStrictFloatingPoint(false);
			inferredJvmType.setFinal(false);

			// Generate the annotations.
			translateAnnotationsTo(source.getAnnotations(), inferredJvmType);

			// Generate the extended types.
			appendConstrainedExtends(context, inferredJvmType, Capacity.class, SarlCapacity.class, source.getExtends());

			// Issue #363: do not generate the capacity if the SARL library is incompatible.
			if (Utils.isCompatibleSARLLibraryOnClasspath(this.typeReferences, source)) {
				// Generate the members of the generated type.
				appendAOPMembers(
						inferredJvmType,
						source,
						context);
			}

			// Add the @FunctionalInterface
			appendFunctionalInterfaceAnnotation(inferredJvmType);

			// Add the specification version of SARL
			appendSARLSpecificationVersion(context, source, inferredJvmType);

			// Add the type of SARL Element
			appendSARLElementType(source, inferredJvmType);

			// Resolving any name conflict with the generated JVM type
			this.nameClashResolver.resolveNameClashes(inferredJvmType);
		} finally {
			closeContext(context);
		}

		// Generate the context aware wrapper
		appendCapacityContextAwareWrapper(source, inferredJvmType);
	}
1055810
public JvmTypeReference inferredType() {
		XComputedTypeReference result = xtypesFactory.createXComputedTypeReference();
		result.setTypeProvider(new InferredTypeIndicator(null));
		return result;
	}
858622
protected void init(int initialMaxSize, Class<T> type, Factory<T> factory) {
		this.size = 0;
		this.type = type;
		this.factory = factory;

		data = (T[]) Array.newInstance(type, initialMaxSize);

		if( factory != null ) {
			for( int i = 0; i < initialMaxSize; i++ ) {
				try {
					data[i] = createInstance();
				} catch( RuntimeException e ) {
					throw new RuntimeException("declareInstances is true, but createInstance() can't create a new instance.  Maybe override createInstance()?");
				}
			}
		}
	}
822075
public void setMimeType(MimeType mimeType) {
        if (mimeType != null) {
            getState().mimeType = mimeType.getMimeType();
        } else {
            getState().mimeType = null;
        }
    }
977130
public void initResourceTypeToMaxCpuMap(Map<Integer, Map<ResourceType,
                                          Integer>> cpuToResourcePartitioning) {
    resourceTypeToMaxCpu =
      getResourceTypeToCountMap((int) clusterNodeInfo.total.numCpus,
        cpuToResourcePartitioning);
  }
1363771
@Check(CheckType.NORMAL)
	public void checkMultipleCapacityUses(SarlCapacityUses uses) {
		if (!isIgnored(REDUNDANT_CAPACITY_USE)) {
			final XtendTypeDeclaration declaringType = uses.getDeclaringType();
			if (declaringType != null) {
				final Set<String> previousCapacityUses = doGetPreviousCapacities(uses,
						declaringType.getMembers().iterator());
				int index = 0;
				for (final JvmTypeReference capacity : uses.getCapacities()) {
					if (previousCapacityUses.contains(capacity.getIdentifier())) {
						addIssue(MessageFormat.format(
								Messages.SARLValidator_79,
								capacity.getSimpleName()),
								uses,
								SARL_CAPACITY_USES__CAPACITIES,
								index,
								REDUNDANT_CAPACITY_USE,
								capacity.getSimpleName());
					} else {
						previousCapacityUses.add(capacity.getIdentifier());
					}
					++index;
				}
			}
		}
	}
1316102
@Override
	public JvmType getType() {
		if (type == null) {
			JvmGenericType objectType = TypesFactory.eINSTANCE.createJvmGenericType();
			String objectClassName = Object.class.getName();
			((InternalEObject) objectType).eSetProxyURI(URIHelperConstants.OBJECTS_URI.appendSegment(objectClassName).appendFragment(objectClassName));
			setType(objectType);
		}
		return super.getType();
	}
72520
protected void initBytes(StringBuilder source) {

    if (this.bytes == null) {
      if (this.string != null) {
        String encodingValue = getEncoding();
        try {
          this.bytes = this.string.getBytes(encodingValue);
        } catch (UnsupportedEncodingException e) {
          source.append(".encoding");
          throw new NlsIllegalArgumentException(encodingValue, source.toString(), e);
        }
      } else if (this.hex != null) {
        this.bytes = parseBytes(this.hex, "hex");
      } else {
        throw new XmlInvalidException(
            new NlsParseException(XML_TAG, XML_ATTRIBUTE_HEX + "|" + XML_ATTRIBUTE_STRING, source.toString()));
      }
    }
  }
539957
public final void entryRuleJvmParameterizedTypeReference() throws RecognitionException {
        try {
            // InternalXtype.g:134:1: ( ruleJvmParameterizedTypeReference EOF )
            // InternalXtype.g:135:1: ruleJvmParameterizedTypeReference EOF
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getJvmParameterizedTypeReferenceRule()); 
            }
            pushFollow(FOLLOW_1);
            ruleJvmParameterizedTypeReference();

            state._fsp--;
            if (state.failed) return ;
            if ( state.backtracking==0 ) {
               after(grammarAccess.getJvmParameterizedTypeReferenceRule()); 
            }
            match(input,EOF,FOLLOW_2); if (state.failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
517887
@Fix(io.sarl.lang.validation.IssueCodes.INVALID_CAPACITY_TYPE)
	public void fixInvalidCapacityType(final Issue issue, IssueResolutionAcceptor acceptor) {
		CapacityReferenceRemoveModification.accept(this, issue, acceptor);
	}
709700
public void init(ServletConfig servletConfig) throws ServletException {
		super.init(servletConfig);
		// If contributing bundle has a mime.types file in the META-INF directory, then
		// add the contents to the map
		URL url = getContributingBundle().getResource("META-INF/mime.types"); //$NON-NLS-1$
		if (url != null) {
			// Some implementations of MimetypesFileTypeMap (e.g. servicemix) don't
			// implement addMimeTypes() correctly, requiring us to feed it the mime.types
			// file line-by-line.
			BufferedReader reader = null;
			try {
				reader = new BufferedReader(new InputStreamReader(url.openStream()));
				String line;
				while ((line = reader.readLine()) != null) {
					super.fileTypeMap.addMimeTypes(line);
				}
			} catch (IOException e) {
				if (log.isLoggable(Level.WARNING)) {
					log.log(Level.WARNING, e.getMessage(), e);
				}
			} finally {
				if (reader != null) {
					IOUtils.closeQuietly(reader);
				}
			}
		}
		Dictionary<String, String> dict = new Hashtable<String, String>();
		dict.put("name", getName()); //$NON-NLS-1$
		registrations.add(new ServiceRegistrationOSGi(Activator.getBundleContext().registerService(
				IAggregator.class.getName(), this, dict)));

	}
70851
public void initialize(final BaseJavaFileObject javaSourceFileObject,
		final BaseJavaFileObject compiledJavaFileObject)
	{
		this.javaSourceFileObject = javaSourceFileObject;
		this.compiledJavaFileObject = compiledJavaFileObject;
		this.runtimeCompilerClassLoader.setCompiledJavaFileObject(this.compiledJavaFileObject);
	}
535372
public void init(String strQueueName, String strQueueType, Object source, RemoteSession session, Map propertiesForFilter, boolean bPrivate)
    {
        super.init(strQueueName, strQueueType, source, null);
        m_session = session;
        m_propertiesForFilter = propertiesForFilter;
        m_bPrivate = bPrivate;
        this.setThinTarget(true);   // Yes, this is always a thin target
    }
1346589
public static synchronized void initialise() throws SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "initialise");
        if (!initialised)
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(tc, "not previously initialised");

            //   new com.ibm.ws.sib.jfapchannel.impl.ClientConnectionManagerImpl();
            Class clientImpl = instance.getClass();
            Method initialiseMethod;
            try
            {
                initialiseMethod = clientImpl.getMethod("initialise", new Class[] {});
                initialiseMethod.invoke(clientImpl, new Object[] {});
                initialised = true; // D223632
            } catch (Exception e)
            {
                FFDCFilter.processException
                                (e, "com.ibm.ws.sib.jfapchannel.ClientConnectionManager.initialise",
                                 JFapChannelConstants.CLNTCONNMGR_INITIALISE_01);

                SibTr.error(tc, "EXCP_DURING_INIT_SICJ0002", new Object[] { "initialise", JFapChannelConstants.CLIENT_MANAGER_CLASS, e });
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    SibTr.exception(tc, e);
                throw new SIResourceException(e);
            }

        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "initialise");
    }
485048
@Override
	public void ensureJvmMembersInitialized() {
		if (jvmMemberInitializers == null)
			return;
		Set<Runnable> localRunnables = null;
		synchronized(this) {
			localRunnables = jvmMemberInitializers;
			jvmMemberInitializers = null;
			hasJvmMemberInitializers = false;
		}
		if (localRunnables == null)
			return;
		boolean wasDeliver = eDeliver();
		LinkedHashSet<Triple<EObject, EReference, INode>> before = resolving;
		try {
			eSetDeliver(false);
			if (!before.isEmpty()) {
				resolving = new LinkedHashSet<Triple<EObject, EReference, INode>>();
			}
			if (isInitializingJvmMembers) {
				throw new IllegalStateException("Reentrant attempt to initialize JvmMembers");
			}
			try {
				isInitializingJvmMembers = true;
				for (Runnable runnable : localRunnables) {
					runnable.run();
				}
			} finally {
				isInitializingJvmMembers = false;
			}
		} catch (Exception e) {
			log.error(e.getMessage(), e);
		} finally {
			if (!before.isEmpty()) {
				resolving = before;
			}
			eSetDeliver(wasDeliver);
		}
	}
1325228
void init() {
        if (dataSource == null) {
            if (connectionType.equals(ConnectionType.POOLED)) {
                HikariConfig config = new HikariConfig();
                config.setMaximumPoolSize(maximumPoolSize);
                config.setDataSourceClassName(dataSourceClass);
                config.addDataSourceProperty("url", url);
                config.addDataSourceProperty("user", user);
                config.addDataSourceProperty("password", password);
                config.setPoolName(CONNECTION_POOL_NAME);
                config.setAutoCommit(autoCommit);
                config.setMaximumPoolSize(maximumPoolSize);
              //  config.setConnectionTestQuery("SELECT 1");
                
                if (connectionTimeout != null) {
                    config.setConnectionTimeout(connectionTimeout);
                }
                if (idleTimeout != null) {
                    config.setIdleTimeout(idleTimeout);
                }
                if (maxLifetime != null) {
                    config.setMaxLifetime(maxLifetime);
                }
                if (minimumIdle != null) {
                    config.setMinimumIdle(minimumIdle);
                }

                ds = new HikariDataSource(config);
                dataSource = ds;

            } else if (connectionType.equals(ConnectionType.JNDI)) {
                if (null == jndiDataSource) {
                    throw new InitializationException("Could not obtain the db connection: jndi data source is null");
                }
                String DATASOURCE_CONTEXT = jndiDataSource;
                try {
                    Context initialContext = new InitialContext();
                    dataSource = (DataSource) initialContext.lookup(DATASOURCE_CONTEXT);
                    if (dataSource == null) {
                        Log.error("Failed to lookup datasource.");
                        throw new InitializationException(
                                "Could not obtain the db connection: Failed to lookup datasource: " + jndiDataSource);
                    }
                } catch (NamingException ex) {
                    throw new InitializationException("Could not obtain the db connection: jndi lookup failed", ex);
                }
            }
        }
    }
321592
void initialCapacity(String key, @Nullable String value) {
    requireArgument(initialCapacity == UNSET_INT,
        "initial capacity was already set to %,d", initialCapacity);
    initialCapacity = parseInt(key, value);
  }