Examples of ObjectKey


Examples of at.molindo.esi4j.chain.Esi4JEntityResolver.ObjectKey

    TypeMapping mapping;

    String id;
    if (entity instanceof ObjectKey) {
      ObjectKey key = (ObjectKey) entity;
      mapping = context.findTypeMapping(key.getType());
      id = mapping.toIdString(key.getId());
    } else {
      mapping = context.findTypeMapping(entity);
      id = mapping.getIdString(entity);
    }
View Full Code Here

Examples of com.sun.corba.ee.spi.ior.ObjectKey

      java.util.Iterator iter = ior.iterator();

      byte[] oid = null;
      if (iter.hasNext()) {
    TaggedProfile profile = (TaggedProfile) iter.next();
    ObjectKey objKey = profile.getObjectKey();
    oid = objKey.getId().getId();
      }

      long containerId = -1;
      int keyLength = -1;
      if ((oid != null) && (oid.length > INSTANCEKEY_OFFSET)) {
View Full Code Here

Examples of com.sun.corba.ee.spi.ior.ObjectKey

                    .getIOR(effective_target, false);
                java.util.Iterator iter = ior.iterator();

                if (iter.hasNext()) {
                    TaggedProfile profile = (TaggedProfile) iter.next();
                    ObjectKey objKey = profile.getObjectKey();
                    this.oid = objKey.getId().getId();
                   
                    SimpleKeyGenerator gen = new SimpleKeyGenerator();
                    this.instanceKey = gen.byteArrayToKey(oid, INSTANCEKEY_OFFSET, 20);
                   
                    validate();
View Full Code Here

Examples of com.sun.corba.se.spi.ior.ObjectKey

        GIOPVersion version = new GIOPVersion() ;
        version.read( istr ) ;
        IIOPAddress primary = new IIOPAddressImpl( istr ) ;
        byte[] key = EncapsulationUtility.readOctets( istr ) ;

        ObjectKey okey = orb.getObjectKeyFactory().create( key ) ;
        oktemp = okey.getTemplate() ;
        oid = okey.getId() ;

        proftemp = IIOPFactories.makeIIOPProfileTemplate( orb,
            version, primary ) ;

        // Handle any tagged components (if applicable)
View Full Code Here

Examples of com.sun.corba.se.spi.ior.ObjectKey

               oktemp.equals( other.getObjectKeyTemplate() ) ;
    }

    public ObjectKey getObjectKey()
    {
        ObjectKey result = IORFactories.makeObjectKey( oktemp, oid ) ;
        return result ;
    }
View Full Code Here

Examples of com.sun.corba.se.spi.ior.ObjectKey

            // correct ORBVersion set, we must finish initializing the
            // stream.
            ((MarshalInputStream)request.getInputObject())
                .performORBVersionSpecificInit();

            ObjectKey okey = request.getObjectKey();

            // Check that this server is the right server
            try {
                checkServerId(okey);
            } catch (ForwardException fex) {
                if (orb.subcontractDebugFlag) {
                    dprint(".dispatch: " + opAndId(request)
                           + ": bad server id");
                }

                request.getProtocolHandler()
                    .createLocationForward(request, fex.getIOR(), null);
                return;
            }

            String operation = request.getOperationName();
            ObjectAdapter objectAdapter = null ;

            try {
                byte[] objectId = okey.getId().getId() ;
                ObjectKeyTemplate oktemp = okey.getTemplate() ;
                objectAdapter = findObjectAdapter(oktemp);

                java.lang.Object servant = getServantWithPI(request, objectAdapter,
                    objectId, oktemp, operation);
View Full Code Here

Examples of com.sun.corba.se.spi.ior.ObjectKey

        IIOPProfile profile = ior.getProfile();

        if (addrDisp == KeyAddr.value) {
            // object key will be used for target addressing
            profile = ior.getProfile();
            ObjectKey objKey = profile.getObjectKey();
            byte[] object_key = objKey.getBytes(orb);
            requestMessage =
                   createRequest(orb, gv, encodingVersion, request_id,
                                 response_expected, object_key,
                                 operation, service_contexts,
                                 requesting_principal);
View Full Code Here

Examples of com.sun.corba.se.spi.ior.ObjectKey

     */
    static ObjectKey extractObjectKey(byte[] objKey, ORB orb) {

        try {
            if (objKey != null) {
                ObjectKey objectKey =
                    orb.getObjectKeyFactory().create(objKey);
                if (objectKey != null) {
                    return objectKey;
                }
            }
View Full Code Here

Examples of com.sun.corba.se.spi.ior.ObjectKey

        try {
            switch (reqAddrDisp) {
            case KeyAddr.value :
                byte[] objKey = target.object_key();
                if (objKey != null) { // AddressingDisposition::KeyAddr
                    ObjectKey objectKey =
                        orb.getObjectKeyFactory().create(objKey);
                    if (objectKey != null) {
                       return objectKey;
                   }
                }
                break;
            case ProfileAddr.value :
                IIOPProfile iiopProfile = null;
                TaggedProfile profile = target.profile();
                if (profile != null) { // AddressingDisposition::ProfileAddr
                   iiopProfile = IIOPFactories.makeIIOPProfile(orb, profile);
                   ObjectKey objectKey = iiopProfile.getObjectKey();
                   if (objectKey != null) {
                       return objectKey;
                   }
                }
                break;
            case ReferenceAddr.value :
                IORAddressingInfo iorInfo = target.ior();
                if (iorInfo != null) { // AddressingDisposition::IORAddr
                    profile = iorInfo.ior.profiles[iorInfo.selected_profile_index];
                    iiopProfile = IIOPFactories.makeIIOPProfile(orb, profile);
                    ObjectKey objectKey = iiopProfile.getObjectKey();
                    if (objectKey != null) {
                       return objectKey;
                   }
                }
                break;
View Full Code Here

Examples of com.sun.corba.se.spi.ior.ObjectKey

        // If there is no KeyString then it's invalid
        if( theKeyString == null ) {
            return null;
        }

        ObjectKey key = orb.getObjectKeyFactory().create(
            theKeyString.getBytes() );
        IORTemplate iortemp = IORFactories.makeIORTemplate( key.getTemplate() );
        java.util.Iterator iterator = theEndpointInfo.iterator( );
        while( iterator.hasNext( ) ) {
            IIOPEndpointInfo element =
                (IIOPEndpointInfo) iterator.next( );
            IIOPAddress addr = IIOPFactories.makeIIOPAddress( orb, element.getHost(),
                element.getPort() );
            GIOPVersion giopVersion = GIOPVersion.getInstance( (byte)element.getMajor(),
                                             (byte)element.getMinor());
            IIOPProfileTemplate profileTemplate = null;
            if (giopVersion.equals(GIOPVersion.V1_0)) {
                profileTemplate = IIOPFactories.makeIIOPProfileTemplate(
                    orb, giopVersion, addr);
                profileList1_0.add(profileTemplate);
            } else {
                if (profileMap.get(giopVersion) == null) {
                    profileTemplate = IIOPFactories.makeIIOPProfileTemplate(
                        orb, giopVersion, addr);
                    profileMap.put(giopVersion, profileTemplate);
                } else {
                    profileTemplate = (IIOPProfileTemplate)profileMap.get(giopVersion);
                    AlternateIIOPAddressComponent iiopAddressComponent =
                                IIOPFactories.makeAlternateIIOPAddressComponent(addr);
                    profileTemplate.add(iiopAddressComponent);
                }
            }
        }

        GIOPVersion giopVersion = orb.getORBData().getGIOPVersion();
        IIOPProfileTemplate pTemplate = (IIOPProfileTemplate)profileMap.get(giopVersion);
        if (pTemplate != null) {
            iortemp.add(pTemplate); // Add profile for GIOP version used by this ORB
            profileMap.remove(giopVersion); // Now remove this value from the map
        }

        // Create a comparator that can sort in decending order (1.2, 1.1, ...)
        Comparator comp = new Comparator() {
            public int compare(Object o1, Object o2) {
                GIOPVersion gv1 = (GIOPVersion)o1;
                GIOPVersion gv2 = (GIOPVersion)o2;
                return (gv1.lessThan(gv2) ? 1 : (gv1.equals(gv2) ? 0 : -1));
            };
        };

        // Now sort using the above comparator
        List list = new ArrayList(profileMap.keySet());
        Collections.sort(list, comp);

        // Add the profiles in the sorted order
        Iterator iter = list.iterator();
        while (iter.hasNext()) {
            IIOPProfileTemplate pt = (IIOPProfileTemplate)profileMap.get(iter.next());
            iortemp.add(pt);
        }

        // Finally add the 1.0 profiles
        iortemp.addAll(profileList1_0);

        IOR ior = iortemp.makeIOR( orb, "", key.getId() ) ;
        return ORBUtility.makeObjectReference( ior ) ;
    }
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.