Package com.volantis.map.operation

Examples of com.volantis.map.operation.OperationNotFoundException


            // todo: delegate to the Operation Engine here, which does exactly the same
            ServiceReference[] references =
                context.getBundleContext().getServiceReferences(
                    Operation.class.getName(), "(operationType=ics)");
            if (null == references || references.length < 1) {
                throw new OperationNotFoundException(
                    "operation-type-not-found",
                    descriptor.getResourceType());
            } else {
                Result result = Result.UNSUPPORTED;
                for (int i=0; i< references.length &&
                    result == Result.UNSUPPORTED; i++) {

                    ServiceReference ref = references[i];
                    Object service =
                        context.getBundleContext().getService(ref);
                    if (null == service) {
                        Object[] params = new Object[] {
                            ref.getProperty("service.pid"),
                            ref.getBundle().getSymbolicName()
                        };
                        LOGGER.error("service-has-been-unregistered", params);
                    } else {
                        Operation operation =
                            (Operation) service;
                        result  = operation.execute(
                            descriptor, request, response);
                    }
                }
                if (result == Result.UNSUPPORTED) {
                    throw new OperationNotFoundException(
                        "no-plugin-available",
                            new String[] { descriptor.getExternalID(), descriptor.getResourceType() });
                }
            }
        } catch (OperationNotFoundException x) {
View Full Code Here


            ServiceReference[] references =
                context.getBundleContext().getServiceReferences(
                    Operation.class.getName(), null);
            if (null == references || references.length < 1) {
                throw new OperationNotFoundException(
                    "operation-type-not-found",
                    localDescriptor.getResourceType());
            } else {
                Result result = Result.UNSUPPORTED;
                for (int i=0; i< references.length &&
                    result == Result.UNSUPPORTED; i++) {

                    ServiceReference ref = references[i];
                    Object service =
                        context.getBundleContext().getService(ref);
                    if (null == service) {
                        Object[] params = new Object[] {
                            ref.getProperty("service.pid"),
                            ref.getBundle().getSymbolicName()
                        };
                        LOGGER.error("service-has-been-unregistered", params);
                    } else {
                        Operation operation =
                            (Operation) service;
                        result  = operation.execute(
                            localDescriptor, request, response);
                    }
                }
                if (result == Result.UNSUPPORTED) {
                    throw new OperationNotFoundException(
                            "no-plugin-available",
                                new String[] { localDescriptor.getExternalID(),
                                        localDescriptor.getResourceType() });
                }
            }

        } catch (InvalidSyntaxException e) {
            // this can never happen as we don't use a filter.
            throw new OperationNotFoundException(
                "syntax-error-in-filter", null, e);
        }
    }
View Full Code Here

TOP

Related Classes of com.volantis.map.operation.OperationNotFoundException

Copyright © 2018 www.massapicom. 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.