Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed Oct 3, 2012
1 parent 02af0c9 commit 7774133
Showing 1 changed file with 13 additions and 16 deletions.
Expand Up @@ -52,22 +52,19 @@

import de.novanic.eventservice.service.registry.EventRegistry;
import de.novanic.eventservice.service.registry.EventRegistryFactory;
import lombok.extern.slf4j.Slf4j;

@Scope(ScopeType.APPLICATION)
@Name("translationWorkspaceManager")
@Slf4j
public class TranslationWorkspaceManagerImpl implements TranslationWorkspaceManager
{
private static final Logger LOGGER = LoggerFactory.getLogger(TranslationWorkspaceManagerImpl.class);

@In
private AccountDAO accountDAO;

@In
private GravatarService gravatarServiceImpl;

@In
private ProjectDAO projectDAO;

@In
private ProjectIterationDAO projectIterationDAO;

Expand All @@ -91,7 +88,7 @@ public TranslationWorkspaceManagerImpl()
@Observer(ZanataInit.EVENT_Zanata_Startup)
public void start()
{
LOGGER.info("starting...");
log.info("starting...");

Runtime.getRuntime().addShutdownHook(new Thread()
{
Expand All @@ -109,10 +106,10 @@ public void exitWorkspace(String username)
String httpSessionId = getSessionId();
if (httpSessionId == null)
{
LOGGER.debug("Logout: null session");
log.debug("Logout: null session");
return;
}
LOGGER.info("Logout: Removing user {} from all workspaces, session: {}", username, httpSessionId);
log.info("Logout: Removing user {} from all workspaces, session: {}", username, httpSessionId);
String personName = "<unknown>";
String personEmail = "<unknown>";
HAccount account = accountDAO.getByUsername(username);
Expand All @@ -131,7 +128,7 @@ public void exitWorkspace(String username)
Collection<EditorClientId> editorClients = workspace.removeEditorClients(httpSessionId);
for (EditorClientId editorClientId : editorClients)
{
LOGGER.info("Publishing ExitWorkspace event for user {} with editorClientId {} from workspace {}", new Object[] { username, editorClientId, workspace.getWorkspaceContext() });
log.info("Publishing ExitWorkspace event for user {} with editorClientId {} from workspace {}", new Object[]{username, editorClientId, workspace.getWorkspaceContext()});
// Send GWT Event to client to update the userlist
ExitWorkspace event = new ExitWorkspace(editorClientId, new Person(new PersonId(username), personName, gravatarServiceImpl.getUserImageUrl(16, personEmail)));
workspace.publish(event);
Expand All @@ -153,7 +150,7 @@ private String getSessionId()
public void projectUpdate(HIterationProject project)
{
String projectSlug = project.getSlug();
LOGGER.info("Project {} updated, status={}", projectSlug, project.getStatus());
log.info("Project {} updated, status={}", projectSlug, project.getStatus());

for (HProjectIteration iter : project.getProjectIterations())
{
Expand All @@ -168,7 +165,7 @@ public void projectIterationUpdate(HProjectIteration projectIteration)
String iterSlug = projectIteration.getSlug();
HProject project = projectIteration.getProject();
Boolean isProjectActive = projectIterationIsActive(project.getStatus(), projectIteration.getStatus());
LOGGER.info("Project {} iteration {} updated, status={}, isProjectActive={}", new Object[] { projectSlug, iterSlug, projectIteration.getStatus(), isProjectActive });
log.info("Project {} iteration {} updated, status={}, isProjectActive={}", new Object[]{projectSlug, iterSlug, projectIteration.getStatus(), isProjectActive});

ProjectIterationId iterId = new ProjectIterationId(projectSlug, iterSlug);
for (TranslationWorkspace workspace : projIterWorkspaceMap.get(iterId))
Expand All @@ -186,8 +183,8 @@ private boolean projectIterationIsActive(EntityStatus projectStatus, EntityStatu
@Destroy
public void stop()
{
LOGGER.info("stopping...");
LOGGER.info("closing down {} workspaces: ", workspaceMap.size());
log.info("stopping...");
log.info("closing down {} workspaces: ", workspaceMap.size());
}

private void stopListeners()
Expand All @@ -198,13 +195,13 @@ private void stopListeners()
// configured in eventservice.properties.
Set<String> registeredUserIds = eventRegistry.getRegisteredUserIds();
int clientCount = registeredUserIds.size();
LOGGER.info("Removing {} client(s)", clientCount);
log.info("Removing {} client(s)", clientCount);
for (String userId : registeredUserIds)
{
LOGGER.debug("Removing client {}", userId);
log.debug("Removing client {}", userId);
eventRegistry.unlisten(userId);
}
LOGGER.info("Removed {} client(s). Waiting for outstanding polls to time out...", clientCount);
log.info("Removed {} client(s). Waiting for outstanding polls to time out...", clientCount);
}

public int getWorkspaceCount()
Expand Down

0 comments on commit 7774133

Please sign in to comment.