Set the default application ID of an application servlet.

@param sDefaultApplicationID
The last application ID to be set. May be <code>null</code>.
@return this for chaining
164097
@Nonnull
  public PhotonGlobalState setDefaultApplicationID (@Nullable final String sDefaultApplicationID)
  {
    m_aRWLock.writeLocked ( () -> {
      if (!EqualsHelper.equals (m_sDefaultApplicationID, sDefaultApplicationID))
      {
        m_sDefaultApplicationID = sDefaultApplicationID;
        if (LOGGER.isInfoEnabled ())
          LOGGER.info ("Default application ID set to '" + sDefaultApplicationID + "'");
      }
    });
    return this;
  }
1014643
private DefaultSipApplicationRouterInfo getFirstRequestApplicationEntry(
            List<? extends SipApplicationRouterInfo> defaultSipApplicationRouterInfoList, SipServletRequest initialRequest) {
        SipSession sipSession = initialRequest.getSession(false);
        if (sipSession != null) {
            String appName = sipSession.getApplicationSession().getApplicationName();
            Iterator<? extends SipApplicationRouterInfo> iterator = defaultSipApplicationRouterInfoList.iterator();
            while (iterator.hasNext()) {
                DefaultSipApplicationRouterInfo next = (DefaultSipApplicationRouterInfo) iterator.next();
                if (next.getApplicationName().equals(appName))
                    return next;
            }
        }
        return null;
    }
1250485
protected void setApplicationObject() {
        try {
            Object app = createApplication();
            context.setAttribute(APP, app);
            initializer.set(app);
        } catch (Error e) {
            LOGGER.log(Level.SEVERE, "Failed to initialize "+getApplicationName(),e);
            initializer.setException(e);
            throw e;
        } catch (RuntimeException e) {
            LOGGER.log(Level.SEVERE, "Failed to initialize "+getApplicationName(),e);
            initializer.setException(e);
            throw e;
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, "Failed to initialize "+getApplicationName(),e);
            initializer.setException(e);
            throw new Error(e);
        } finally {
            // in case the above catch clauses miss this.
            if (!initializer.isDone())
                initializer.cancel(true);
        }
    }
531144
@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		try {
			HashSet<Class<?>> registeredTypes = new HashSet<>();

			// Get Service Broker
			ServiceBroker broker = applicationContext.getBean(ServiceBroker.class);

			// Find Services in Spring Application Context
			Map<String, Service> serviceMap = applicationContext.getBeansOfType(Service.class);
			if (serviceMap != null && !serviceMap.isEmpty()) {
				String name;
				for (Map.Entry<String, Service> service : serviceMap.entrySet()) {

					// Register Service in Broker
					name = service.getKey();
					registeredTypes.add(service.getClass());
					if (name != null && name.startsWith("$")) {
						broker.createService(name, service.getValue());
						logger.info("Service \"" + name + "\" registered.");
					} else {
						Service instance = service.getValue();
						broker.createService(instance);
						logger.info("Service \"" + instance.getName() + "\" registered.");
					}
				}
			}

			// Add new Services
			if (packagesToScan != null && packagesToScan.length > 0) {
				DefaultListableBeanFactory beanFactory = (DefaultListableBeanFactory) applicationContext
						.getAutowireCapableBeanFactory();
				for (String packageName : packagesToScan) {
					if (!packageName.isEmpty()) {
						LinkedList<String> classNames = scan(packageName);
						for (String className : classNames) {
							if (className.indexOf('$') > -1) {
								continue;
							}
							className = packageName + '.' + className;
							Class<?> type = Class.forName(className);
							if (Service.class.isAssignableFrom(type)) {

								// Check type
								if (!registeredTypes.add(type)) {
									continue;
								}

								// Register Service in Spring
								String name = nameOf(type, false);
								BeanDefinition definition = BeanDefinitionBuilder.genericBeanDefinition(type)
										.setScope(BeanDefinition.SCOPE_SINGLETON)
										.setAutowireMode(DefaultListableBeanFactory.AUTOWIRE_BY_TYPE).setLazyInit(false)
										.getBeanDefinition();
								beanFactory.registerBeanDefinition(name, definition);
								Service service = (Service) beanFactory.createBean(type);

								// Register Service in Broker
								broker.createService(service);

								// Log
								logger.info("Service \"" + name + "\" registered.");
							}
						}
					}
				}
			}
		} catch (Exception cause) {
			throw new FatalBeanException("Unable to define Moleculer Service!", cause);
		}
	}
801006
public function setAppId($appId = null)
    {
        return $this->set($this->appIdColumn, $appId ?: wei()->app->getId());
    }
397394
public ApplicationConfig setId(String id) {
        if (this.id.equals(this.name)) {
            // keep name and id in sync if no custom name was specified
            this.name = id;
        }
        this.id = id;
        return this;
    }
1085110
protected void configureAndRefreshPortletApplicationContext(ConfigurablePortletApplicationContext pac, PortletContext pc) {
        if (ObjectUtils.identityToString(pac).equals(pac.getId())) {
            // The application context id is still set to its original default value
            // -> assign a more useful id based on available information
            String idParam = pc.getInitParameter(CONTEXT_ID_PARAM);
            if (idParam != null) {
                pac.setId(idParam);
            }
            else {
                // Generate default id...
                pac.setId(ConfigurablePortletApplicationContext.APPLICATION_CONTEXT_ID_PREFIX +
                        ObjectUtils.getDisplayString(pc.getPortletContextName()));
            }
        }

        // Determine parent for root web application context, if any.
        ApplicationContext parent = loadParentContext(pc);

        pac.setParent(parent);
        pac.setPortletContext(pc);
        String initParameter = pc.getInitParameter(CONFIG_LOCATION_PARAM);
        if (initParameter != null) {
            pac.setConfigLocation(initParameter);
        }
        else {
            try {
                pac.setConfigLocation("/WEB-INF/portletApplicationContext.xml");
            }
            catch (UnsupportedOperationException e) {
                //Ignore, may get triggered if the context doesn't support config locations
            }
        }
        customizeContext(pc, pac);
        pac.refresh();
    }
55807
private ApplicationType getApplicationType() {
		ApplicationType applicationType = ApplicationType.Factory.newInstance();
		applicationType.setTypeOfApplication(getTypeOfApplication());
		return applicationType;
	}
139777
func (s *CreateStreamingURLInput) SetApplicationId(v string) *CreateStreamingURLInput {
	s.ApplicationId = &v
	return s
}
30673
private void setDefaultUserAgent() {
        setUserAgent(
                MwsUtl.escapeAppName(applicationName),
                MwsUtl.escapeAppVersion(applicationVersion),
                MwsUtl.escapeAttributeValue("Java/"
                        + System.getProperty("java.version") + "/"
                        + System.getProperty("java.class.version") + "/"
                        + System.getProperty("java.vendor")),

                MwsUtl.escapeAttributeName("Platform"),
                MwsUtl.escapeAttributeValue("" + System.getProperty("os.name")
                        + "/" + System.getProperty("os.arch") + "/"
                        + System.getProperty("os.version")),

                MwsUtl.escapeAttributeName("MWSClientVersion"),
                MwsUtl.escapeAttributeValue(libraryVersion));
    }
579704
@Override
    public void setApplicationContext(ApplicationContext applicationContext) {
        if (context == null) {
            synchronized (ApplicationContextHolder.class) {
                if (context == null) {
                    ApplicationContextHolder.context = applicationContext;
                }
            }
        }
    }
1083964
public MobicentsSipApplicationSession createApplicationSession(SipContext sipContext) {
		if (logger.isDebugEnabled()) {
			logger.debug("Creating new application session for sip context "+ sipContext.getApplicationName());
		}
		//call id not needed anymore since the sipappsessionkey is not a callid anymore but a random uuid
		SipApplicationSessionKey sipApplicationSessionKey = SessionManagerUtil.getSipApplicationSessionKey(
				sipContext.getApplicationName(), 
				null,
				null);		
		MobicentsSipApplicationSession sipApplicationSession = sipContext.getSipManager().getSipApplicationSession(
				sipApplicationSessionKey, true);
		
		if(StaticServiceHolder.sipStandardService.isHttpFollowsSip()) {
			String jvmRoute = StaticServiceHolder.sipStandardService.getJvmRoute();
			if(jvmRoute != null) {
				sipApplicationSession.setJvmRoute(jvmRoute);
			}
		}
			
		return sipApplicationSession.getFacade();
	}
1192711
public OvhApplication api_application_applicationId_GET(Long applicationId) throws IOException {
		String qPath = "/me/api/application/{applicationId}";
		StringBuilder sb = path(qPath, applicationId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhApplication.class);
	}
1067819
@Nonnull
  public FineUploader5Paste setDefaultName (@Nonnull @Nonempty final String sDefaultName)
  {
    ValueEnforcer.notEmpty (sDefaultName, "DefaultName");
    m_sPasteDefaultName = sDefaultName;
    return this;
  }
1327974
@Override
    public Application onApplicationInit(Application app, JaxRsModuleMetaData metaData) {

        Class<?> clazz = app.getClass();

        if (!shouldHandle(clazz, true)) {
            return null;
        }
        Application newApp = null;

        ManagedObject<?> mo = getClassFromManagedObject(clazz);
        metaData.setManagedAppRef(mo);

        if (mo != null) {
            newApp = (Application) (mo.getObject());
        }

        if (newApp == null) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "App: app is null from CDI , get app from rs for " + app.getClass().getName());
            }
            return app;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "App: get app from CDI " + app.getClass().getName());
        }
        return newApp;
    }
87898
public static void setInstance(Application application) {
		if (application == Application.instance) {
			return;
		}
		if (Application.instance != null) {
			throw new IllegalStateException("Application cannot be changed");
		}		
		if (application == null) {
			throw new IllegalArgumentException("Application cannot be null");
		}
		Application.instance = application;
	}
1153179
public ApplicationID getApplicationID() throws IOException {
    final String url = "ws/v1/cluster/apps/new-application";
    final HttpPost post = preparePost(url);
    try (final CloseableHttpResponse response = this.httpClient.execute(post, this.httpClientContext)) {
      final String message = IOUtils.toString(response.getEntity().getContent());
      final ApplicationID result = this.objectMapper.readValue(message, ApplicationID.class);
      return result;
    }
  }