当前位置: 首页>>代码示例>>Java>>正文


Java SessionInfoImpl类代码示例

本文整理汇总了Java中org.uberfire.rpc.impl.SessionInfoImpl的典型用法代码示例。如果您正苦于以下问题:Java SessionInfoImpl类的具体用法?Java SessionInfoImpl怎么用?Java SessionInfoImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SessionInfoImpl类属于org.uberfire.rpc.impl包,在下文中一共展示了SessionInfoImpl类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sessionInfo

import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
private SessionInfo sessionInfo(final WatchContext context) {
    final String sessionId;
    final String user;
    if (context.getSessionId() == null) {
        sessionId = "<system>";
    } else {
        sessionId = context.getSessionId();
    }
    if (context.getUser() == null) {
        user = "<system>";
    } else {
        user = context.getUser();
    }

    return new SessionInfoImpl(sessionId,
                               new UserImpl(user));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:IOWatchServiceExecutorImpl.java

示例2: reloadEditorOnUpdateFromDifferentUser

import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
@Test
public void reloadEditorOnUpdateFromDifferentUser() {
    lockManager.onResourceUpdated(new ResourceUpdatedEvent(path,
                                                           "",
                                                           new SessionInfoImpl(user)));

    assertEquals(0,
                 reloads);

    lockManager.onResourceUpdated(new ResourceUpdatedEvent(path,
                                                           "",
                                                           new SessionInfoImpl(new UserImpl("differentUser"))));

    assertEquals(1,
                 reloads);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:LockManagerTest.java

示例3: copyPath

import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
Path copyPath(final Path path,
              final String newName,
              final Path targetPath,
              final String comment) {
    final org.uberfire.java.nio.file.Path _path = Paths.convert(path);
    final org.uberfire.java.nio.file.Path _target = Paths.convert(targetPath);

    try {
        ioService.startBatch(_target.getFileSystem());

        ioService.copy(_path,
                       _target,
                       new CommentedOption(sessionInfo != null ? sessionInfo.getId() : "--",
                                           identity.getIdentifier(),
                                           null,
                                           comment));

        //Delegate additional changes required for a copy to applicable Helpers
        if (helpers != null) {
            for (CopyHelper helper : helpers) {
                if (helper.supports(targetPath)) {
                    helper.postProcess(path,
                                       targetPath);
                }
            }
        }
    } catch (final Exception e) {
        throw new RuntimeException(e);
    } finally {
        endBatch();
    }

    resourceCopiedEvent.fire(new ResourceCopiedEvent(path,
                                                     targetPath,
                                                     comment,
                                                     sessionInfo != null ? sessionInfo : new SessionInfoImpl("--",
                                                                                                             identity)));

    return targetPath;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:41,代码来源:CopyServiceImpl.java

示例4: releaseLockOnUpdate

import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
@Test
public void releaseLockOnUpdate() {
    lockManager.acquireLockOnDemand();
    simulateLockSuccess();
    simulateLockDemand();

    lockManager.onResourceUpdated(new ResourceUpdatedEvent(path,
                                                           "",
                                                           new SessionInfoImpl(user)));

    verify(lockService,
           times(1)).releaseLock(any(Path.class),
                                 any(ParameterizedCommand.class));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:15,代码来源:LockManagerTest.java

示例5: releaseOwnedLockOnly

import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
@Test
public void releaseOwnedLockOnly() {
    lockManager.acquireLockOnDemand();
    simulateLockFailure();
    simulateLockDemand();

    lockManager.onResourceUpdated(new ResourceUpdatedEvent(path,
                                                           "",
                                                           new SessionInfoImpl(user)));

    verify(lockService,
           never()).releaseLock(any(Path.class),
                                any(ParameterizedCommand.class));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:15,代码来源:LockManagerTest.java

示例6: getSessionInfo

import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
@Produces
@RequestScoped
@Default
public SessionInfo getSessionInfo(AuthenticationService authenticationService) {
    String sessionId = getSessionId();
    User user;
    if (sessionId == null) {
        user = getDefaultUser();
        sessionId = user.getIdentifier();
    } else {
        user = authenticationService.getUser();
    }
    return new SessionInfoImpl(sessionId,
                               user);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:16,代码来源:UberFireGeneralFactory.java

示例7: getSessionInfo

import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
@Override
@Produces
@Default
@ApplicationScoped
public SessionInfo getSessionInfo(AuthenticationService authenticationService) {
    return new SessionInfoImpl("dummy-id", authenticationService.getUser());
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:8,代码来源:CommandLineSetup.java

示例8: createSessionInfo

import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
@Produces
protected SessionInfo createSessionInfo(InjectionPoint injectionPoint) {
    return new SessionInfoImpl(new UserImpl(Thread.currentThread().getName()));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:5,代码来源:WorkspaceBuilderServiceTest.java

示例9: currentSession

import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
@Produces
@ApplicationScoped
private SessionInfo currentSession(User identity) {
    return new SessionInfoImpl(identity);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:6,代码来源:PluginEntryPoint.java

示例10: getSessionInfo

import org.uberfire.rpc.impl.SessionInfoImpl; //导入依赖的package包/类
private SessionInfo getSessionInfo( final String sessionId ) {
    return new SafeSessionInfo( new SessionInfoImpl( sessionId,
                                                     authenticationService.getUser() ) );
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:5,代码来源:DecisionTableXLSServiceImpl.java


注:本文中的org.uberfire.rpc.impl.SessionInfoImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。