Creates a new child session.
169735
private ClientSession newSession() {
    ClientSession session = new ClientSession(clientId, transport.client(), selector, ioContext, connectionStrategy, sessionTimeout,
                                              unstabilityTimeout
    );

    // Update the session change listener.
    if (changeListener != null)
      changeListener.close();
    changeListener = session.onStateChange(this::onStateChange);

    // Register all event listeners.
    eventListeners.forEach(l -> l.register(session));
    return session;
  }
1062263
public void triggerSessionCreated(JingleSession jingleSession) {
        jingleSessions.add(jingleSession);
        jingleSession.addListener(this);
        for (CreatedJingleSessionListener createdJingleSessionListener : creationListeners) {
            try {
                createdJingleSessionListener.sessionCreated(jingleSession);
            } catch (Exception e) {
                LOGGER.log(Level.WARNING, "exception", e);
            }
        }
    }
895359
def createSessionForKey(self, key, user):
        
        PersistentSession(
            store=self.store,
            sessionKey=key,
            authenticatedAs=user)
386098
function createSession (callback) {
      var path, sessionCreate;

      _log(me.setting);
      path = me.setting.apiroot + '/session/create.json?apiKey=' + me.setting.apikey;
      _log(path);

      sessionCreate = http.request({
        port: me.setting.port,
        host: me.setting.host,
        method: 'POST',
        path: path
      });

      sessionCreate.on('response', function (response) {
        var data = '';

        _log('STATUS: ' + response.statusCode);
        _log('HEADERS: ' + JSON.stringify(response.headers));

        if (200 !== response.statusCode) {
          callback(response.statusCode);
          return;
        }

        response.on('data', function (chunk) {
          data += chunk;
        });

        response.on('end', function() {
          var sessionInfo = JSON.parse(data);
          _log('SID OK: ' + sessionInfo.sid);

          callback(response.statusCode, sessionInfo);
        });
      });

      sessionCreate.on('error', function(err) {
        console.error(err);
      });

      sessionCreate.end();
    }
265108
@SuppressWarnings("unchecked")
	public void sessionCreated(HttpSessionEvent se) {
		Descriptor<? extends Context> descriptor = container.contexts().get(Session.class);
		
		if (descriptor != null) {
			WebContext<HttpSession> context = (WebContext<HttpSession>) container.component(descriptor);
			context.associate(se.getSession());
		}
	}
664112
def add_child(self, child):
        
        if isinstance(child, BaseCitation):
            self._children.append(child)
889378
def create_database_session(engine):
    """"""

    try:
        Session = sessionmaker(bind=engine)
        return Session()
    except OperationalError as e:
        raise DatabaseError(error=e.orig.args[1], code=e.orig.args[0])
530563
def _create_websession(self):
        """"""
        from socket import AF_INET
        from aiohttp import ClientTimeout, TCPConnector

        _LOGGER.debug('Creating web session')
        conn = TCPConnector(
            family=AF_INET,
            limit_per_host=5,
            enable_cleanup_closed=True,
        )

        # Create session object.
        session_timeout = ClientTimeout(connect=10)
        self._websession = ClientSession(connector=conn,
                                         timeout=session_timeout)
        self._supplied_websession = False
809345
private Session createNewSession() {
		Session session = model.newSession();
		getProxy().setIgnoreList(model.getOptionsParam().getGlobalExcludeURLParam().getTokensNames());
		return session;
	}
110228
function Child(file) {
  if (!(this instanceof Child))
    return new Child(file);

  EventEmitter.call(this);

  bindExit();
  children.add(this);

  this.init(file);
}
1293447
def create(cls, user, **kwargs):
        """"""
        parent_id = kwargs.get(cls.parent_resource.resource_type + '_id')
        try:
            parent = yield cls.parent_resource.get(parent_id)
        except couch.NotFound:
            msg = 'Parent {} with id {} not found'.format(
                cls.parent_resource.resource_type,
                parent_id)
            raise exceptions.ValidationError(msg)

        if not parent.editable:
            err = 'Cannot create child of {} resource'.format(parent.state.name)
            raise exceptions.Unauthorized(err)

        resource = yield super(SubResource, cls).create(user, **kwargs)
        resource._parent = parent

        raise Return(resource)
1360099
def create_exposed_session(self, session, key=None, context=None):
        
        if key:
            return WebDelegatingSession(self, key)

        web_registry = context['web_registry']
        session_key = WebSessionKey(session.session_id,
                                    web_registry=web_registry)

        return WebDelegatingSession(self, session_key)
1317126
private void addChild(Session session, GroupImpl parent, GroupImpl child, boolean broadcast) throws Exception
   {
      Node parentNode = utils.getGroupNode(session, parent);
      Node groupNode =
         parentNode.addNode(child.getGroupName(), JCROrganizationServiceImpl.JOS_HIERARCHY_GROUP_NODETYPE);

      String parentId = parent == null ? null : parent.getId();

      child.setParentId(parentId);
      child.setInternalId(groupNode.getUUID());

      if (broadcast)
      {
         preSave(child, true);
      }

      writeGroup(child, groupNode);
      session.save();

      putInCache(child);

      if (broadcast)
      {
         postSave(child, true);
      }
   }
1160463
def create(cls, community_id, user_id, **data):
        """"""
        with db.session.begin_nested():
            obj = cls(id=community_id, id_user=user_id, **data)
            db.session.add(obj)
        return obj
598093
def _new_session(self):
        
        if self.labels:
            return self._database.session(labels=self.labels)
        return self._database.session()
145244
def create_session(self, uid, duration=0):

        '''
            
        '''
    
        title = '%s.create_session' % self.__class__.__name__
        
    # validate inputs
        input_fields = {
            'uid': uid,
            'duration': duration
        }
        for key, value in input_fields.items():
            if value:
                object_title = '%s(%s=%s)' % (title, key, str(value))
                self.fields.validate(value, '.%s' % key, object_title)
        
    # construct request fields
        url = self.bucket_url + '/_session'
        json_data = {
            'name': uid
        }
        if duration:
            json_data['ttl'] = duration
    
    # send request and unwrap response
        response = requests.post(url, json=json_data)
        response = response.json()
    
        return response
408012
def new_children(self, **kwargs):
        """"""
        for k, v in kwargs.items():
            self.new_child(k, v)

        return self