Package de.fu_berlin.inf.dpp.project.internal

Examples of de.fu_berlin.inf.dpp.project.internal.SarosSession


        }

        this.sessionID.setValue(String.valueOf(sessionRandom
            .nextInt(Integer.MAX_VALUE)));

        SarosSession sarosSession = new SarosSession(this.transmitter,
            dispatchThreadContext, new DateTime(), sarosContext);

        this.sarosSessionObservable.setValue(sarosSession);

        notifySarosSessionStarting(sarosSession);
        sarosSession.start();
        notifySarosSessionStarted(sarosSession);

        for (Entry<IProject, List<IResource>> mapEntry : projectResourcesMapping
            .entrySet()) {
            IProject iProject = mapEntry.getKey();
            List<IResource> resourcesList = mapEntry.getValue();
            if (!iProject.isOpen()) {
                try {
                    iProject.open(null);
                } catch (CoreException e1) {
                    log.debug("An error occur while opening project", e1); //$NON-NLS-1$
                    continue;
                }
            }
            String projectID = String.valueOf(sessionRandom
                .nextInt(Integer.MAX_VALUE));
            sarosSession.addSharedResources(iProject, projectID, resourcesList);
            notifyProjectAdded(iProject);
        }

        SarosSessionManager.log.info("Session started"); //$NON-NLS-1$
    }
View Full Code Here


     * {@inheritDoc}
     */
    public ISarosSession joinSession(JID host, int colorID,
        DateTime sessionStart) {

        SarosSession sarosSession = new SarosSession(transmitter,
            dispatchThreadContext, host, colorID, sessionStart, sarosContext);

        this.sarosSessionObservable.setValue(sarosSession);

        log.info("Saros session joined"); //$NON-NLS-1$
View Full Code Here

                + "stopSharedProjectLock."); //$NON-NLS-1$
            return;
        }

        try {
            SarosSession sarosSession = (SarosSession) sarosSessionObservable
                .getValue();

            if (sarosSession == null) {
                return;
            }

            notifySessionEnding(sarosSession);

            this.transmitter.sendLeaveMessage(sarosSession);
            log.debug("Leave message sent."); //$NON-NLS-1$
            if (!sarosSession.isStopped()) {
                try {
                    sarosSession.stop();
                } catch (RuntimeException e) {
                    log.error("Error stopping project: ", e); //$NON-NLS-1$
                }
            }
            sarosSession.dispose();

            this.sarosSessionObservable.setValue(null);

            notifySessionEnd(sarosSession);
View Full Code Here

TOP

Related Classes of de.fu_berlin.inf.dpp.project.internal.SarosSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.