Examples of RuntimeResource


Examples of com.asakusafw.runtime.core.RuntimeResource

        Configuration conf = new Configuration();
        conf.set("test", "OK");
        RuntimeResourceManager manager = new RuntimeResourceManager(conf) {
            @Override
            protected List<RuntimeResource> load() throws IOException {
                RuntimeResource adapter = new Adapter() {
                    @Override
                    public void setup(ResourceConfiguration configuration) {
                        passed.addAndGet(1);
                        assertThat(configuration.get("test", null), is("OK"));
                    }
View Full Code Here

Examples of com.asakusafw.runtime.core.RuntimeResource

        Configuration conf = new Configuration();
        conf.set("test", "OK");
        RuntimeResourceManager manager = new RuntimeResourceManager(conf) {
            @Override
            protected List<RuntimeResource> load() throws IOException {
                RuntimeResource adapter = new Adapter() {
                    @Override
                    public void cleanup(ResourceConfiguration configuration) {
                        passed.addAndGet(1);
                        assertThat(configuration.get("test", null), is("OK"));
                    }
View Full Code Here

Examples of com.asakusafw.runtime.core.RuntimeResource

        final AtomicInteger passed = new AtomicInteger();
        Configuration conf = new Configuration();
        RuntimeResourceManager manager = new RuntimeResourceManager(conf) {
            @Override
            protected List<RuntimeResource> load() throws IOException {
                RuntimeResource adapter = new Adapter() {
                    @Override
                    public void setup(ResourceConfiguration configuration) throws IOException {
                        if (passed.get() >= 3) {
                            throw new IOException();
                        }
View Full Code Here

Examples of org.glassfish.jersey.server.model.RuntimeResource

            // Sub-resource path.
            final ExtendedUriInfo uriInfo = extendedUriInfoProvider.get();
            final List<RuntimeResource> matchedRuntimeResources = uriInfo.getMatchedRuntimeResources();
            if (matchedRuntimeResources.size() > 1) {
                // > 1 to check that we matched sub-resource
                final RuntimeResource lastMatchedRuntimeResource = matchedRuntimeResources.get(0);
                final Resource lastMatchedResource = lastMatchedRuntimeResource.getResources().get(0);

                String path = lastMatchedResource.getPath();

                if (path != null && !IMPLICIT_VIEW_PATH_PARAMETER_TEMPLATE.equals(path)) {
                    path = path.charAt(0) == '/' ? path.substring(1, path.length()) : path;
View Full Code Here

Examples of org.glassfish.jersey.server.model.RuntimeResource

            // Sub-resource path.
            final ExtendedUriInfo uriInfo = extendedUriInfoProvider.get();
            final List<RuntimeResource> matchedRuntimeResources = uriInfo.getMatchedRuntimeResources();
            if (matchedRuntimeResources.size() > 1) {
                // > 1 to check that we matched sub-resource
                final RuntimeResource lastMatchedRuntimeResource = matchedRuntimeResources.get(0);
                final Resource lastMatchedResource = lastMatchedRuntimeResource.getResources().get(0);

                String path = lastMatchedResource.getPath();

                if (path != null && !IMPLICIT_VIEW_PATH_PARAMETER_TEMPLATE.equals(path)) {
                    path = path.charAt(0) == '/' ? path.substring(1, path.length()) : path;
View Full Code Here

Examples of org.glassfish.jersey.server.model.RuntimeResource


        @Override
        public Response apply(ContainerRequestContext containerRequestContext) {

            final RuntimeResource resource = extendedUriInfo.getMatchedRuntimeResources().get(0);
            // TODO: support multiple resources, see ignored tests in WadlResourceTest.Wadl8Test
            final UriInfo uriInfo = containerRequestContext.getUriInfo();

            final Application wadlApplication = wadlApplicationContext.getApplication(uriInfo,
                    resource.getResources().get(0), WadlUtils.isDetailedWadlRequested(uriInfo));

            if (wadlApplication == null) {
                // wadlApplication can be null if limited WADL is requested and all content
                // of wadlApplication is invisible in limited WADL
                return Response.status(Response.Status.NOT_FOUND).build();
View Full Code Here

Examples of org.glassfish.jersey.server.model.RuntimeResource


        @Override
        public Response apply(ContainerRequestContext containerRequestContext) {

            final RuntimeResource resource = extendedUriInfo.getMatchedRuntimeResources().get(0);
            // TODO: support multiple resources, see ignored tests in WadlResourceTest.Wadl8Test
            final Application wadlApplication = wadlApplicationContext.getApplication(
                    containerRequestContext.getUriInfo(),
                    resource.getResources().get(0));


            byte[] bytes;
            try {
                final Marshaller marshaller = wadlApplicationContext.getJAXBContext().createMarshaller();
View Full Code Here

Examples of org.uberfire.security.authz.RuntimeResource

    @AroundInvoke
    public Object interceptInvoke( final InvocationContext ctx ) throws Exception {

        final Method method = ctx.getMethod();

        final RuntimeResource resource = new RuntimeResource() {

            List<String> roles = null;
            List<String> traits = null;

            @Override
View Full Code Here

Examples of org.uberfire.security.authz.RuntimeResource

        }
        boolean refreshCache = false;
        if (resource instanceof Cacheable) {
            refreshCache = ((Cacheable) resource).requiresRefresh();
        }
        final RuntimeResource runtimeResource = (RuntimeResource) resource;

        if (cache.notContains(subject, runtimeResource) || refreshCache) {
            if (!resourceManager.requiresAuthentication(runtimeResource)) {
                return ACCESS_ABSTAIN;
            }
View Full Code Here

Examples of org.uberfire.security.authz.RuntimeResource

    @Test
    public void testAuthorizeWithCacheRefreshOnRemoveAllRoles() {
        RuntimeAuthorizationManager authorizationManager = new RuntimeAuthorizationManager();

        RuntimeResource resource = new TestRuntimeResource("test1234", "author");
        Subject john = new TestIdentity("john", "admin");
        Subject mary = new TestIdentity("mary", "author");

        assertTrue(resource instanceof Cacheable);
        assertTrue(((Cacheable) resource).requiresRefresh());

        boolean authorized = authorizationManager.authorize(resource, john);
        assertFalse(authorized);
        assertFalse(((Cacheable) resource).requiresRefresh());

        authorized = authorizationManager.authorize(resource, mary);
        assertTrue(authorized);
        // now simulate remove of the roles for the resource
        RuntimeResource resource2 = new TestRuntimeResource("test1234"null);

        assertTrue(((Cacheable) resource2).requiresRefresh());

        authorized = authorizationManager.authorize(resource2, john);
        assertTrue(authorized);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.