Package net.jini.id

Examples of net.jini.id.Uuid


    }

    @Test
    public void testGetOrganization() {
        ServiceElement element = makeServiceElement("Foo");
        Uuid uuid = UuidFactory.generate();
        ServiceRecord record = new ServiceRecord(uuid, element, "hostname");
        ServiceStatement statement = new ServiceStatement(element);
        statement.putServiceRecord(recordingUuid, record);
        String organization = statement.getOrganization();
        Assert.assertNotNull(organization);
View Full Code Here


            sbLifeCycleManager = new LifeCycleManager();

        checkUtilityConfiguration(config);
        ComputeResource computeResource = new ComputeResource(config);

        Uuid serviceID = UuidFactory.generate();
        DefaultServiceBeanManager serviceBeanManager = new DefaultServiceBeanManager(sElem,
                                               computeResource.getHostName(),
                                               computeResource.getAddress().getHostAddress(),
                                               serviceID);
        serviceBeanManager.setDiscardManager(sbLifeCycleManager);
View Full Code Here

                        provisioner.getServiceResourceSelector().getInstantiatorResources(svcElement);
                    for(InstantiatorResource resource : resources) {
                        try {
                            ServiceRecord[] records = resource.getActiveServiceRecords();
                            for(ServiceRecord record : records) {
                                Uuid uuid = record.getServiceID();
                                ServiceBeanConfig sbc = record.getServiceElement().getServiceBeanConfig();
                                for (ServiceBeanInstance instance : instances) {
                                    if (instance.getServiceBeanID().equals(uuid)) {
                                        instance.setServiceBeanConfig(sbc);
                                        addServiceBeanInstance(instance);
View Full Code Here

                mgrLogger.trace("ServiceElement [{}] Instantiator count={}, ServiceBeanInstance count={}, "+
                                 "synch testManager with discovered instances",
                                 LoggingUtil.getLoggingName(svcElement), irArray.length, sbInstances.length);
                int lastID = 0;
                for (ServiceBeanInstance sbInstance : sbInstances) {
                    Uuid uuid = sbInstance.getServiceBeanID();
                    Object proxy = sbInstance.getService();
                    if(proxy instanceof RemoteMethodControl)
                        proxy = proxyPreparer.prepareProxy(sbInstance.getService());
                    ServiceID serviceID = new ServiceID(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits());
                    try {
                        setFaultDetectionHandler(proxy, serviceID);
                        addServiceProxy(proxy);
                        addServiceBeanInstance(sbInstance);
                        /* Check the instanceID, make sure we maintain the
View Full Code Here

     * ServiceBeanInstantiator cannot be obtained
     */
    void relocate(final ServiceBeanInstance instance,
                  final ServiceProvisionListener svcProvisionListener,
                  final Uuid requestedUuid) throws OperationalStringException {
        Uuid excludeUuid = null;
        ServiceResource[] resources =
            provisioner.getServiceResourceSelector().getServiceResources(instance.getHostAddress(), true);
        for (ServiceResource resource : resources) {
            InstantiatorResource ir = (InstantiatorResource) resource.getResource();
            if (ir.hasServiceElementInstance(svcElement, instance.getServiceBeanID())) {
View Full Code Here

        if(serviceID==null)
            return;
        if(fdhTable.containsKey(serviceID))
            return;
        if(proxy instanceof ReferentUuid) {
            Uuid uuid = ((ReferentUuid)proxy).getReferentUuid();
            if(myUuid.equals(uuid)) {
                /* Discovered instance of ourself, no FaultDetectionHandler needed */
                return;
            }
        }
View Full Code Here

     * @throws IOException
     */
    private ServiceBeanInstance createServiceBeanInstance(final ServiceItem item) throws IOException {
        ServiceBeanInstance instance = null;
        /* Create a uuid from the ServiceID */
        Uuid uuid = UuidFactory.create(item.serviceID.getMostSignificantBits(),
                                       item.serviceID.getLeastSignificantBits());

        /* Make sure we dont already have a ServiceBeanInstance for the item */
        ServiceBeanInstance[] instances = getServiceBeanInstances();

        for (ServiceBeanInstance sbi : instances) {
            if (sbi.getServiceBeanID().equals(uuid)) {
                instance = sbi;
                break;
            }
        }
        if(instance==null) {
            String hostName = null;
            String hostAddress = null;
            ServiceBeanConfig jsbConfig = null;
            Uuid instantiatorUuid = null;
            if(item.service instanceof Administrable) {
                Object admin = ((Administrable)item.service).getAdmin();
                if(admin instanceof ServiceBeanAdmin) {
                    ServiceBeanAdmin jsbAdmin = (ServiceBeanAdmin)admin;
                    jsbConfig = jsbAdmin.getServiceElement().getServiceBeanConfig();
View Full Code Here

    public void importServiceBeanInstance(final ServiceBeanInstance instance) throws Exception {
        Object proxy = instance.getService();
        if(proxy instanceof RemoteMethodControl)
            proxy = proxyPreparer.prepareProxy(instance.getService());
        addServiceBeanInstance(instance);
        Uuid uuid = instance.getServiceBeanID();
        ServiceID serviceID = new ServiceID(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits());
        setFaultDetectionHandler(proxy, serviceID);
    }
View Full Code Here

                        }
                        idleServiceManager.get().addService((ServiceActivityProvider)proxy);
                    }

                    if(proxy instanceof MonitorableService) {
                        Uuid uuid = instance.getServiceBeanID();
                        ServiceID serviceID = new ServiceID(uuid.getMostSignificantBits(),
                                                            uuid.getLeastSignificantBits());
                        setFaultDetectionHandler(proxy, serviceID);
                    } else if(proxy instanceof ReferentUuid) {
                        Uuid uuid = ((ReferentUuid)proxy).getReferentUuid();
                        ServiceID serviceID = new ServiceID(uuid.getMostSignificantBits(),
                                                            uuid.getLeastSignificantBits());
                        setFaultDetectionHandler(proxy, serviceID);
                    } else {
                        StringBuilder sb = new StringBuilder();
                        for(Class c : proxy.getClass().getInterfaces()) {
                            if(sb.length()>0)
View Full Code Here

         */
        public synchronized void serviceFailure(final Object proxy, final ServiceID sID) {
            if(shutdown.get())
                return;
            ServiceBeanInstance instance;
            Uuid uuid = UuidFactory.create(sID.getMostSignificantBits(), sID.getLeastSignificantBits());
            mgrLogger.warn("\n********************************\n[{}] service failure, type: {}, proxy: {}, active monitor? {}\n********************************",
                           LoggingUtil.getLoggingName(svcElement),
                           svcElement.getProvisionType(),
                           proxy.getClass().getName(),
                           getActive());
View Full Code Here

TOP

Related Classes of net.jini.id.Uuid

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.