package dslab.rmi.stub.dmap; import dslab.authentication.AuthenticationService; import dslab.mailbox.MailboxManager; import dslab.protocol.dmap.Dmap; import dslab.protocol.dmap.DmapImpl; import dslab.rmi.channel.EncryptableSocketChannel; import dslab.rmi.serialize.dmap.DmapServerSerializer; import dslab.rmi.stub.ServerStub; public class DmapServerStub extends ServerStub { private final AuthenticationService authenticationService; public DmapServerStub(EncryptableSocketChannel channel, AuthenticationService authenticationService, MailboxManager mailboxManager) { super(channel, new DmapServerSerializer(), new DmapImpl(mailboxManager, authenticationService)); this.authenticationService = authenticationService; } @Override protected void afterSession() { authenticationService.logoutIfLoggedIn(); } }