private static Map getParts(EJValue value) { return ErraiProtocolEnvelopeMarshaller.INSTANCE.demarshall(value, new DecodingSession(MappingContextSingleton.get())); }
@SuppressWarnings("unchecked") public static Message createCommandMessage(QueueSession session, String json) { if (json.length() == 0) return null; Message msg = createWithPartsFromRawMap(ErraiProtocolEnvelopeMarshaller.INSTANCE.demarshall(JSONDecoder.decode(json), new DecodingSession(MappingContextSingleton.get()))) .setResource("Session", session) .setResource("SessionID", session.getSessionId()); msg.setFlag(RoutingFlag.FromRemote); return msg; }
@Override public void init(FilterConfig filterConfig) throws ServletException { // Initialize server side marshaller MappingContextSingleton.get(); }
private void initializeMarshaller() { MappingContextSingleton.get(); }
@Override public void initialize(FilterConfig filterConfig) { String contextRelativeHostPageUri = filterConfig.getInitParameter(HOST_PAGE_INIT_PARAM); if (contextRelativeHostPageUri == null) { throw new IllegalStateException( "FormAuthenticationScheme requires that you set the filter init parameter \"" + HOST_PAGE_INIT_PARAM + "\" to the context-relative URI of the host page."); } hostPageUri = filterConfig.getServletContext().getContextPath() + contextRelativeHostPageUri; String contextRelativeLoginPageUri = filterConfig.getInitParameter(LOGIN_PAGE_INIT_PARAM); if (contextRelativeLoginPageUri == null) { throw new IllegalStateException( "FormAuthenticationScheme requires that you set the filter init parameter \"" + LOGIN_PAGE_INIT_PARAM + "\" to the context-relative URI of the login page."); } loginPageUri = filterConfig.getServletContext().getContextPath() + contextRelativeLoginPageUri; // this ensures Errai Marshalling has been set up (for encoding the cookie) MappingContextSingleton.get(); }
@Override public void initialize(FilterConfig filterConfig) { String contextRelativeHostPageUri = filterConfig.getInitParameter(HOST_PAGE_INIT_PARAM); if (contextRelativeHostPageUri == null) { throw new IllegalStateException( "FormAuthenticationScheme requires that you set the filter init parameter \"" + HOST_PAGE_INIT_PARAM + "\" to the context-relative URI of the host page."); } hostPageUri = filterConfig.getServletContext().getContextPath() + contextRelativeHostPageUri; String contextRelativeLoginPageUri = filterConfig.getInitParameter(LOGIN_PAGE_INIT_PARAM); if (contextRelativeLoginPageUri == null) { throw new IllegalStateException( "FormAuthenticationScheme requires that you set the filter init parameter \"" + LOGIN_PAGE_INIT_PARAM + "\" to the context-relative URI of the login page."); } loginPageUri = filterConfig.getServletContext().getContextPath() + contextRelativeLoginPageUri; // this ensures Errai Marshalling has been set up (for encoding the cookie) MappingContextSingleton.get(); }
@Override public void init(FilterConfig filterConfig) throws ServletException { MappingContextSingleton.get(); String commaSeparatedRoles = filterConfig.getInitParameter(PROBE_ROLES_INIT_PARAM); if (commaSeparatedRoles != null) { for (final String role : Collections.unmodifiableList(Arrays.asList(commaSeparatedRoles.split(",")))) { RoleRegistry.get().registerRole(role); } } }
@Override public void init(FilterConfig filterConfig) throws ServletException { MappingContextSingleton.get(); String commaSeparatedRoles = filterConfig.getInitParameter(PROBE_ROLES_INIT_PARAM); if (commaSeparatedRoles != null) { for (final String role : Collections.unmodifiableList(Arrays.asList(commaSeparatedRoles.split(",")))) { RoleRegistry.get().registerRole(role); } } }
private static Map getParts(EJValue value) { return ErraiProtocolEnvelopeMarshaller.INSTANCE.demarshall(value, new DecodingSession(MappingContextSingleton.get())); }
@Override public Set<String> getCandidate(final GeneratorContext context, final DiscoveryContext discoveryContext) { final ServerMappingContext ctx = MappingContextSingleton.get(); final Map<String, String> matchNames = new HashMap<String, String>(); for (final MetaClass cls : ctx.getDefinitionsFactory().getExposedClasses()) { matchNames.put(cls.getName(), cls.getName()); } final File cwd = new File("").getAbsoluteFile(); final Set<File> roots = findMatchingOutputDirectoryByModel(matchNames, cwd); if (roots.isEmpty()) { discoveryContext.veto(); } final Set<String> rootsPaths = new HashSet<String>(); for (final File f : roots) { rootsPaths.add(f.getAbsolutePath()); } return rootsPaths; } }
@Before public void prepare() throws Exception { MappingContextSingleton.get(); }
@Before public void prepare() throws Exception { MappingContextSingleton.get(); }
public static Message uglyReEncode(String message) { if (message == null) return null; Map<String, Object> parts = ErraiProtocolEnvelopeMarshaller.INSTANCE.demarshall(JSONDecoder.decode(message), new DecodingSession(MappingContextSingleton.get())); return CommandMessage.createWithParts(parts); }
public static Message uglyReEncode(String message) { if (message == null) return null; Map<String, Object> parts = ErraiProtocolEnvelopeMarshaller.INSTANCE.demarshall(JSONDecoder.decode(message), new DecodingSession(MappingContextSingleton.get())); return CommandMessage.createWithParts(parts); }
public static Message decodeAndDemarshall(String json) { Map<String, Object> parts = ErraiProtocolEnvelopeMarshaller.INSTANCE.demarshall(JSONDecoder.decode(json), new DecodingSession(MappingContextSingleton.get())); if (parts == null) return CommandMessage.create(); return CommandMessage.createWithParts(parts); } }
public static Message decodeAndDemarshall(String json) { Map<String, Object> parts = ErraiProtocolEnvelopeMarshaller.INSTANCE.demarshall(JSONDecoder.decode(json), new DecodingSession(MappingContextSingleton.get())); if (parts == null) return CommandMessage.create(); return CommandMessage.createWithParts(parts); } }
@SuppressWarnings("unchecked") public static Message createCommandMessage(QueueSession session, String json) { if (json.length() == 0) return null; Message msg = createWithPartsFromRawMap(ErraiProtocolEnvelopeMarshaller.INSTANCE.demarshall(JSONDecoder.decode(json), new DecodingSession(MappingContextSingleton.get()))) .setResource("Session", session) .setResource("SessionID", session.getSessionId()); msg.setFlag(RoutingFlag.FromRemote); return msg; }
@Before public void init() throws IOException { MappingContextSingleton.get(); fileSystemTestingUtils.setup(); sessionInfo = new SessionInfoMock(USER_NAME); fileSystem = fileSystemTestingUtils.getFileSystem(); ioService = spy(fileSystemTestingUtils.getIoService()); doNothing().when(ioService).startBatch(any(FileSystem.class)); doNothing().when(ioService).endBatch(); doReturn(fileSystem).when(ioService).newFileSystem(any(URI.class), anyMap()); defRegistry = new ExperimentalFeatureDefRegistryImpl(); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_1, true, "", GLOBAL_FEATURE_1, GLOBAL_FEATURE_1)); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_2, true, "", GLOBAL_FEATURE_2, GLOBAL_FEATURE_2)); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_3, true, "", GLOBAL_FEATURE_3, GLOBAL_FEATURE_3)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_1, false, "", FEATURE_1, FEATURE_1)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_2, false, "", FEATURE_2, FEATURE_2)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_3, false, "", FEATURE_3, FEATURE_3)); globalStorage = spy(new GlobalExperimentalFeaturesStorageImpl(sessionInfo, spaces, ioService, defRegistry, event)); userStorage = spy(new UserExperimentalFeaturesStorageImpl(sessionInfo, spaces, ioService, defRegistry)); }
@Before public void init() throws IOException { MappingContextSingleton.get(); fileSystemTestingUtils.setup(); sessionInfo = new SessionInfoMock(USER_NAME); fileSystem = fileSystemTestingUtils.getFileSystem(); ioService = spy(fileSystemTestingUtils.getIoService()); doNothing().when(ioService).startBatch(any(FileSystem.class)); doNothing().when(ioService).endBatch(); doReturn(fileSystem).when(ioService).newFileSystem(any(URI.class), anyMap()); defRegistry = new ExperimentalFeatureDefRegistryImpl(); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_1, true, "", GLOBAL_FEATURE_1, GLOBAL_FEATURE_1)); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_2, true, "", GLOBAL_FEATURE_2, GLOBAL_FEATURE_2)); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_3, true, "", GLOBAL_FEATURE_3, GLOBAL_FEATURE_3)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_1, false, "", FEATURE_1, FEATURE_1)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_2, false, "", FEATURE_2, FEATURE_2)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_3, false, "", FEATURE_3, FEATURE_3)); storage = getStorageInstance(); }
@Before public void init() throws IOException { MappingContextSingleton.get(); fileSystemTestingUtils.setup(); sessionInfo = new SessionInfoMock(USER_NAME); fileSystem = fileSystemTestingUtils.getFileSystem(); ioService = spy(fileSystemTestingUtils.getIoService()); doNothing().when(ioService).startBatch(any(FileSystem.class)); doNothing().when(ioService).endBatch(); doReturn(fileSystem).when(ioService).newFileSystem(any(URI.class), anyMap()); defRegistry = new ExperimentalFeatureDefRegistryImpl(); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_1, true, "", GLOBAL_FEATURE_1, GLOBAL_FEATURE_1)); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_2, true, "", GLOBAL_FEATURE_2, GLOBAL_FEATURE_2)); defRegistry.register(new ExperimentalFeatureDefinition(GLOBAL_FEATURE_3, true, "", GLOBAL_FEATURE_3, GLOBAL_FEATURE_3)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_1, false, "", FEATURE_1, FEATURE_1)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_2, false, "", FEATURE_2, FEATURE_2)); defRegistry.register(new ExperimentalFeatureDefinition(FEATURE_3, false, "", FEATURE_3, FEATURE_3)); storage = getStorageInstance(); }