Examples of DiscoveryException


Examples of org.apache.commons.discovery.DiscoveryException

     */
    public static void verifyAncestory(Class spi, Class impl)
        throws DiscoveryException
    {
        if (spi == null) {
            throw new DiscoveryException("No interface defined!");
        }

        if (impl == null) {
            throw new DiscoveryException("No implementation defined for " + spi.getName());
        }

        if (!spi.isAssignableFrom(impl)) {
            throw new DiscoveryException("Class " + impl.getName() +
                                         " does not implement " + spi.getName());
        }
    }
View Full Code Here

Examples of org.apache.commons.discovery.DiscoveryException

                    // ignore
                }
            }
        }
       
        throw new DiscoveryException("No implementation defined for " + spi.getSPName());
        // return null;
    }
View Full Code Here

Examples of org.apache.tuscany.spi.services.discovery.DiscoveryException

            final MessageListener messageListener = new TuscanyMessageListener(this, runtimeId);
            messageConsumer.setMessageListener(messageListener);
            connection.start();

        } catch (JMSException ex) {
            throw new DiscoveryException(ex);
        }

    }
View Full Code Here

Examples of org.eclipse.persistence.exceptions.DiscoveryException

            Object[] args = null;
            rcm.logInfo("announcement_sent", args);

        } catch (Exception ex) {
            // We got an exception. Map it to an RCM exception and call the handler
            DiscoveryException discoveryEx = DiscoveryException.errorSendingAnnouncement(ex);
            rcm.handleException(discoveryEx);
        }
    }
View Full Code Here

Examples of org.eclipse.persistence.exceptions.DiscoveryException

                communicationSocket = new MulticastSocket(multicastPort);
                communicationSocket.setTimeToLive(getPacketTimeToLive());
                communicationSocket.joinGroup(InetAddress.getByName(multicastGroupAddress));
            } catch (IOException ex) {
                // Either we couldn't create the socket or we couldn't join the group
                DiscoveryException discoveryEx = DiscoveryException.errorJoiningMulticastGroup(ex);
                rcm.handleException(discoveryEx);
            }
        }
    }
View Full Code Here

Examples of org.elasticsearch.discovery.DiscoveryException

    @Override protected void doStart() throws ElasticSearchException {
        try {
            this.datagramPacketReceive = new DatagramPacket(new byte[bufferSize], bufferSize);
            this.datagramPacketSend = new DatagramPacket(new byte[bufferSize], bufferSize, InetAddress.getByName(group), port);
        } catch (Exception e) {
            throw new DiscoveryException("Failed to set datagram packets", e);
        }

        try {
            MulticastSocket multicastSocket;
//            if (NetworkUtils.canBindToMcastAddress()) {
//                try {
//                    multicastSocket = new MulticastSocket(new InetSocketAddress(group, port));
//                } catch (Exception e) {
//                    logger.debug("Failed to create multicast socket by binding to group address, binding to port", e);
//                    multicastSocket = new MulticastSocket(port);
//                }
//            } else {
            multicastSocket = new MulticastSocket(port);
//            }

            multicastSocket.setTimeToLive(ttl);

            // set the send interface
            InetAddress multicastInterface = networkService.resolvePublishHostAddress(address);
            multicastSocket.setInterface(multicastInterface);
            multicastSocket.joinGroup(InetAddress.getByName(group));

            multicastSocket.setReceiveBufferSize(bufferSize);
            multicastSocket.setSendBufferSize(bufferSize);
            multicastSocket.setSoTimeout(60000);

            this.multicastSocket = multicastSocket;
        } catch (Exception e) {
            throw new DiscoveryException("Failed to setup multicast socket", e);
        }

        this.receiver = new Receiver();
        this.receiverThread = daemonThreadFactory(settings, "discovery#multicast#received").newThread(receiver);
        this.receiverThread.start();
View Full Code Here

Examples of org.openid4java.discovery.DiscoveryException

        try
        {
            HttpResponse resp = _httpFetcher.get(hxri);
            if (resp == null || HttpStatus.SC_OK != resp.getStatusCode())
                throw new DiscoveryException("Error retrieving HXRI: " + hxri);

            Set targetTypes = DiscoveryInformation.OPENID_OP_TYPES;

            List endpoints = XRDS_PARSER.parseXrds(resp.getBody(), targetTypes);

            List results = new ArrayList();

            Iterator endpointIter = endpoints.iterator();
            while (endpointIter.hasNext())
            {
                XrdsServiceEndpoint endpoint = (XrdsServiceEndpoint) endpointIter.next();
                Iterator typesIter = endpoint.getTypes().iterator();
                while (typesIter.hasNext()) {
                    String type = (String) typesIter.next();
                    if (!targetTypes.contains(type)) continue;
                    try {
                        results.add(new DiscoveryInformation(
                            new URL(endpoint.getUri()),
                            parseIdentifier(endpoint.getCanonicalId()),
                            DiscoveryInformation.OPENID2.equals(type) ? endpoint.getLocalId() :
                            DiscoveryInformation.OPENID1_SIGNON_TYPES.contains(type) ? endpoint.getDelegate() : null,
                            type));
                    } catch (MalformedURLException e) {
                        throw new DiscoveryException("Invalid endpoint URL discovered: " + endpoint.getUri());
                    }
                }
            }
            return results;
        }
        catch (IOException e)
        {
            throw new DiscoveryException("Error performing discovery on HXRI: " + hxri);
        }
    }
View Full Code Here

Examples of org.openid4java.discovery.DiscoveryException

                rtn = UrlIdentifier.normalize("http://" + username)
                        .toExternalForm();
            }
            System.out.println("rtn |" + rtn + "|");
            if (rtn.equals("http://")) {
                throw new DiscoveryException("Invalid openID: "
                        + username);
            } else {
                return rtn;
            }
        } catch (DiscoveryException e) {
View Full Code Here

Examples of org.openid4java.discovery.DiscoveryException

    @Test(expected = OpenIDConsumerException.class)
    public void discoveryExceptionRaisesOpenIDException() throws Exception {
        ConsumerManager mgr = mock(ConsumerManager.class);
        OpenID4JavaConsumer consumer = new OpenID4JavaConsumer(mgr, new NullAxFetchListFactory());
        when(mgr.discover(anyString())).thenThrow(new DiscoveryException("msg"));
        consumer.beginConsumption(new MockHttpServletRequest(), "", "", "");
    }
View Full Code Here

Examples of org.openid4java.discovery.DiscoveryException

        OpenID4JavaConsumer consumer = new OpenID4JavaConsumer(mgr, new NullAxFetchListFactory());

        when(mgr.verify(anyString(), any(ParameterList.class), any(DiscoveryInformation.class)))
                .thenThrow(new MessageException(""))
                .thenThrow(new AssociationException(""))
                .thenThrow(new DiscoveryException(""));

        MockHttpServletRequest request = new MockHttpServletRequest();
        request.setQueryString("x=5");

        try {
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.