Sharing objects in the same package (context)

Hi,
I need a small example or API invocations which shows object sharing beetween two applets in the same package.
Thanks.

Look at the JavaPurse sample. You'll see the record, ParameterFile, and CyclicFile are shared objects in the same context.

Similar Messages

  • Sharing objects using the shareable interface

    I'm working on a key server-client applet on a Java Card, and have a question.
    The server applet has admin rights and is reponsible for creating keys, i.e. the server creates all key objects. The client applets will only have access, via the shareable interface, to the verify methods of the key objects.
    My question is: Is it possible to get a shareable interface to an already created object, in this case multiple key objects created by the server applet?
    Thank alot.
    Jonas Nilsson

    If they are a part of the same package you can access the objects within the same context. You won't need to implement shareable interfaces if that were the case.
    If not, just implement the shareable interface for the objects you want to share out.
    BUT,
    I'm not to sure you want to share key objects. Just pass that authentication was properly done and leave it at that.

  • Solaris 11 IPS:  How do you post multiple versions of the same package?

    How do you post multiple versions of the same software package on a single IPS instance(port)? Oracle was able to do it here with versions 151 and 175 of S11:
    http://pkg.oracle.com/solaris/release/
    Unfortunately, based on my searches, no where in the documentation (http://www.oracle.com/technetwork/server-storage/solaris11/technologies/ips-323421.html) does it explain to the development community how this is done. The best I can do is create pkg repo instances on different ports to host each different software version.
    We are trying to deploy an IPS repository for our drivers and utilities that our customers can link to and pull updates from. We have been able to post a software package to the repository using the command:
    pkgsend publish -s http://localhost:1234 -d ./ Appv1.p5m
    This posts the package on the IPS repository instance at port 1234 on the server. However, we would like to post multiple versions of the package on the server at the same URL. Why the same URL? So that our customers and end-users need only point to a single URL to pull down our software rather than having to add a new URL to the publisher list each time we have an update. We want at least 5 of the previous software versions to be available on the server. Posting each version of the application or driver on a different IPS instance on a different port will require customers to add multiple URLs to their publisher list and they also will not be able to initiate remote scans for updates.
    Has anybody been able to do this? Is any documentation forthcoming?
    Edited by: user13489824 on Jun 25, 2012 10:17 AM

    dhduvall: Thanks for your response. Yes, one would think that as long as the version numbers are different, you should be able to accumulate multiple versions of a package in a repository. It looks like Oracle has done it in their S11 repository unfortunately, as far as I know, they have not shared the steps on how to do this. I would like to publish two versions of the same package. I.E. two different manifests with two different fmri.pkg version strings and two different binaries.
    If I publish one package after another like this:
    pkgsend publish -s http://localhost:1234 Appv1.p5m
    pkgsend publish -s http://localhost:1234 Appv2.p5m
    Then only the second package shows up in the repository, as if it over-wrote the first one.
    Running pkgsend with two manifest, like this:
    pkgsend publish -s http://localhost:1234 Appv1.p5m Appv2.p5m
    Will cause pkgsend to combine the packages and manifests as if they were a single package... not what I am trying to do.
    Both approaches are complete without errors but neither achieves what I am trying to do.
    alan.pae: Thank you. Unfortunately, the link didn't really help. I've read Oracle's white papers and IPS developer guide so I'm familiar with the topics covered.
    Lex: Yes, I know. I specified the versions in the pkg.fmri value string.

  • Calling a method of one class from another withing the same package

    hi,
    i've some problem in calling a method of one class from another class within the same package.
    for eg. if in Package mypack. i'm having 2 files, f1 and f2. i would like to call a method of f2 from f1(f1 is a servlet) . i donno exactly how to instantiate the object for f2. can anybody please help me in this regard.
    Thank u in advance.
    Regards,
    Fazli

    This is what my exact problem.
    i've created a bean (DataBean) to access the database. i'm having a servlet program (ShopBook). now to check some details over there in the database from the servlet i'm in need to use a method in the DataBean.
    both ShopBook.java and DataBean.java lies in the package shoppack.
    in ShopBook i tried to instantiate the object to DataBean as
    DataBean db = new DataBean();
    it shows the compiler error, unable to resolve symbol DataBean.
    note:
    first i compiled DataBean.java, it got compiled perfectly and the class file resides inside the shoppack.
    when i'm trying to compile the ShopBook its telling this error.
    hope i'm clear in explaining my problem. can u please help me?
    thank u in advance.
    regards,
    Fazli

  • Exporting two remote objects on the same port

    Hi,
    I would like to export two remote objects on the same host, same port and bind them with different service names.
    There is no problem when I do that from the same Java program.
    But when I export and bind an object from a Java program 1, I cannot do the same with the second (and similar) Java program 2. This is the stack trace of my Exception:
    java.rmi.server.ExportException: Port already in use: 50040; nested exception is:
         java.net.BindException: Address already in use: JVM_Bind
         at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:243)
         at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:178)
         at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
         at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
         at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:145)
         at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:129)
         at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:275)
         at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:178)
         at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:75)Can some one help please

    It should work in any version of Java as long as the server socket factories are null or equal according to Object.equals() or its override in the SSF.equals() method if any. Which needs to be present and needs to take the form:
    public boolean equals(Object object)
      return object != null && object.getClass() == this.getClass();
    }with further tests if the server socket factories have additional state.

  • View objects referencing the same entity

    The behaviour occurs in every version of jdeveloper ADF BC i have tried so far (10g, 11g).
    I have 2 updatable view objects referencing the same entity object. When i create a new record using the first view object and before commiting the data to the database i navigate to the second
    view object. Suprisingly the second view object is populated with the same data that is posted on the first view object. It seems like both view objects are referencing the same entity object instance.
    Is any way to overcome this strange behaviour.
    Thanks

    As Timo says think of the EO as a record cache. If you had 700 VOs all based on the same EO, it would be ideal to store the same record(s) 700 times in the midtier as it would consume vasts amount of memory. Thus the EO cache.
    If you do want to separate the VOs, you've 3 options:
    1) Use separate EOs for each VO (not ideal)
    2) Expose each VO under their own root level Application Module - a separate EO cache instance for each VO will be created at runtime - however you need to be careful between the VO/EO pairs, you don't update the same record, as you'll get record locks/contention
    3) If you're using task flows in 11g, use the Always Begin New Transaction option for each screen/fragment for each VO. This is the equivalent of 2 but from the task flow level - however again you need to be careful on record locks.
    CM.

  • How can I verify credit of an itunes card that has already been redeemed?  My Grandson and I both redeemed itune cards on our shared account about the same time. There isn't a credit balance after his purchase?

    How can I verify credit for an itunes card that has already been redeemed?  My Grandson and I both redeemed itune cards on our shared account about the same time. There isn't a credit balance after his purchase?

    Have you checked the account's purchase history to see if anything could have used up the balance : See your purchase history in the iTunes Store - Apple Support ?
    If there aren't any purchases then try logging out and back into the account (e.g. on your iPad tap on your id in Settings > Stores and then log back in) and see if a balance then shows on it. My account's balance shows at the top right of the store's page on my computer's iTunes, by clicking on my name towards the top right of the iTunes screen, and by logging in to view my account via the Store > View Account menu option. On my iPad devices it shows at the bottom of, for example, the Featured tab in the App Store app under my account id (or you can view your account via Settings > Stores and it should show on the screen that you are taken to)

  • RE: multiple named objects with the same name andinterface

    David,
    First I will start by saying that this can be done by using named anchored
    objects and registering them yourself in the name service. There is
    documentation on how to do this. And by default you will get most of the
    behavior you desire. When you do a lookup in the name service (BindObject
    method) it will first look in the local partition and see if there is a
    local copy and give you that copy. By anchoring the object and manually
    registering it in the name service you are programmatically creating your
    own SO without defining it as such in the development environment. BTW in
    response to your item number 1. This should be the case there as well. If
    your "mobile" object is in the same partition where the service object he is
    calling resides, you should get a handle to the local instance of the
    service object.
    Here is the catch, if you make a bind object call and there is no local copy
    you will get a handle to a remote copy but you can not be sure which one!
    It end ups as more or less a random selection. Off the top of my head and
    without going to the doc, I am pretty sure that when you register an
    anchored object you can not limit it's visibility to "User".
    Sean
    -----Original Message-----
    From: [email protected]
    [<a href="mailto:[email protected]">mailto:[email protected]]On</a> Behalf Of David Foote
    Sent: Monday, June 22, 1998 4:51 PM
    To: [email protected]
    Subject: multiple named objects with the same name and interface
    All,
    More than once, I have wished that Forte allowed you to place named
    objects with the same name in more than one partition. There are two
    situations in which this seems desirable:
    1) Objects that are not distributed, but are mobile (passed by value to
    remote objects), cannot safely reference a Service Object unless it has
    environment visibility, but this forces the overhead of a remote method
    call when it might not otherwise be necessary. If it were possible to
    place a copy of the same Service Object (with user visibility) in each
    partition, the overhead of a remote method call could be avoided. This
    would only be useful for a service object whose state could be safely
    replicated.
    2) My second scenario also involves mobile objects referencing a Service
    Object, but this time I would like the behavior of the called Service
    Object to differ with the partition from which it is called.
    This could be accomplished by placing Service Objects with the same name
    and the same interface in each partition, but varying the implementation
    with the partition.
    Does anyone have any thoughts about why this would be a good thing or a
    bad thing?
    David N. Foote
    Consultant
    Get Your Private, Free Email at <a href=
    "http://www.hotmail.com">http://www.hotmail.com</a>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>

    David,
    First I will start by saying that this can be done by using named anchored
    objects and registering them yourself in the name service. There is
    documentation on how to do this. And by default you will get most of the
    behavior you desire. When you do a lookup in the name service (BindObject
    method) it will first look in the local partition and see if there is a
    local copy and give you that copy. By anchoring the object and manually
    registering it in the name service you are programmatically creating your
    own SO without defining it as such in the development environment. BTW in
    response to your item number 1. This should be the case there as well. If
    your "mobile" object is in the same partition where the service object he is
    calling resides, you should get a handle to the local instance of the
    service object.
    Here is the catch, if you make a bind object call and there is no local copy
    you will get a handle to a remote copy but you can not be sure which one!
    It end ups as more or less a random selection. Off the top of my head and
    without going to the doc, I am pretty sure that when you register an
    anchored object you can not limit it's visibility to "User".
    Sean
    -----Original Message-----
    From: [email protected]
    [<a href="mailto:[email protected]">mailto:[email protected]]On</a> Behalf Of David Foote
    Sent: Monday, June 22, 1998 4:51 PM
    To: [email protected]
    Subject: multiple named objects with the same name and interface
    All,
    More than once, I have wished that Forte allowed you to place named
    objects with the same name in more than one partition. There are two
    situations in which this seems desirable:
    1) Objects that are not distributed, but are mobile (passed by value to
    remote objects), cannot safely reference a Service Object unless it has
    environment visibility, but this forces the overhead of a remote method
    call when it might not otherwise be necessary. If it were possible to
    place a copy of the same Service Object (with user visibility) in each
    partition, the overhead of a remote method call could be avoided. This
    would only be useful for a service object whose state could be safely
    replicated.
    2) My second scenario also involves mobile objects referencing a Service
    Object, but this time I would like the behavior of the called Service
    Object to differ with the partition from which it is called.
    This could be accomplished by placing Service Objects with the same name
    and the same interface in each partition, but varying the implementation
    with the partition.
    Does anyone have any thoughts about why this would be a good thing or a
    bad thing?
    David N. Foote
    Consultant
    Get Your Private, Free Email at <a href=
    "http://www.hotmail.com">http://www.hotmail.com</a>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>

  • How to rotate and translate an object at the same time??

    Hi, I have a problem with rotation and translation of an object at the same time. I wrote a behovior class for my object (a cylinder). When some conditions are true the cylinder is added to a robot arm. Then it is translated so that the cylinder would be very close to the arm (looks like the robot is holding it). And now the behavior should also rotate the cylinder because the angle is 0 and it should be 90. I can translate the object or I can rotate the object but when I'm trying to do it at the same time (I want to combine rotation and translation) it doesn't work.
    Could anyone help me, please :)

    You can used to Matrix3f
    This object is a rotation and translate matrix
    for example:
    private void componerTransformada(){
    Quat4f rot = new Quat4f((float) this.getRotacionSobreX(),(float) this.getRotacionSobreY(),
    (float) this.getRotacionSobreZ(),1.0f);
    Vector3f tras = new Vector3f(-4.0f,-4.0f,(-1)*this.getDistanciaDeLaCamara());
    this.setTransformacion(new Transform3D(new Matrix4f(rot, tras, 1.0f)));
    Quat4f is a matrix of ratation
    vector3f is a direction vector
    Transform3d is building with Quat4f and Vector3f.
    That is work i use this to situe the view of point.
    good locky

  • How can we use the same package in our report used by some other report

    how can we use the same package in our report used by some other report

    Hi,
    You just need to assign package while saving your report.
    No extra is required providing you are aware of package to be used.

  • Error: A file found in a source-path must have the same package structure

    I use Adobe Flex Compiler (mxmlc) Version 4.1.0 build 16032,I have a file,named CustomGraphContainerController.as,it's directory is c:\controllers,and the GCController.as file is under the same directory,CustomGraphContainerController.as file like follows
    package controllers{
    import ui.GraphControlContainer;
    public class CustomGraphContainerController extends GCController {
      public function CustomGraphContainerController(a_graphControlContainer:GraphControlContainer) {
       super(a_graphControlContainer);
    Then I want to use mxmlc command to compile it,like follows:
    C:\>mxmlc c:\controllers\CustomGraphContainerController.as
    But it raise compile errors,like follows:
    Loading configuration file C:\sdk\frameworks\flex-config.xml
    C:\controllers\GCController.as: Error: A file found in a source-path must have the same package structure '', as the definition's package, 'controllers'.
    I don't know how to compile the as file with package controllers? Where is wrong? How to use mxmlc to compile it?
    Thanks

    HI,
         You should have one main application class to compile this as code to swf.. So that main application path should be in your proper package structure.. then you can compile you app and as files also...
    Thanks
    Ram..

  • Call to a remote object in the same JVM

    Hi,
    I want to implement a logging mechanism in my system. I'm planning to
    write an rmi object and make it a start up class.
    I wud like to know whether the calls to this start up class made by the
    ejb instances and from the servlet engine in the same JVM, wud be rmi calls
    or wud they be simple method calls.
    Does weblogic detect the calls from the objects of the same jvm and
    optimise them, or wud they be rmi calls only.
    btw, i'm using weblogic 5.1
    thx,
    Manohar

    Try:
    initialNamingContext.rebind("single",
    weblogic.rmi.server.UnicastRemoteObjcet.exportObject(obj)
    "M. Manohar" wrote:
    Hi Eduardo,
    thx for ur reply.
    I wud like to know how to make this "binding a stub".
    wat i'm using is binding an object only.
    Instantiating an object which implements the remote interface and binding
    it to the JNDI tree by,
    initialNamingContext.rebind("single", obj);
    and ofcourse defining it as a start up class in the weblogic.properties
    file.
    Can u pls explain how to do "binding a stub"
    thx,
    Manohar
    Eduardo Ceballos wrote in message <[email protected]>...
    Presuming that the start up class binds itself into the jndi tree, then itonly depends on what you bind: binding a stub results in the RMI runtime
    overhead; binding the object itself, results in the simpler function call
    overhead.
    "M. Manohar" wrote:
    Hi,
    I want to implement a logging mechanism in my system. I'm planning to
    write an rmi object and make it a start up class.
    I wud like to know whether the calls to this start up class made by the
    ejb instances and from the servlet engine in the same JVM, wud be rmi
    calls
    or wud they be simple method calls.
    Does weblogic detect the calls from the objects of the same jvm and
    optimise them, or wud they be rmi calls only.
    btw, i'm using weblogic 5.1
    thx,
    Manohar

  • Process flow fails to complete when another in the same package is deployed - OWB 11.2.0.2

    Hi,
    I have  problem with OWB Process Flows whereby whenever I deploy a process flow within an existing package, another Process Flow becomes (unknown to me) invalid and will not complete execution.
    When deploying the first process flow, I am synchronising all mappings within it, saving, validating and saving again before deploying it. This process flow then functions ok but then a random process flow within the same package malfunctions. By this I mean the process flow does not complete, as if it has lost some connectors. Has anybody else had this problem?

    HI Richard,
    Thanks for your reply. Yes I agree with your answer but sadly this does not seem to be the cause of the problem in my case as I always stop any running processes and double check with the list_requests.sql as provided and where necessary execute the deactivate_execution.sql and/or abort_exec_request.sql only if absolutely required. Finally I check again with list_requests.sql and if necessary run in the OWF_MGR schema: WF_PURGE.TOTAL and/or the following sql (again only if required) :
    BEGIN
    FOR cur_rec in (SELECT ITEM_TYPE,ITEM_KEY FROM OWF_MGR.WF_ITEM_ACTIVITY_STATUSES
      WHERE ACTIVITY_STATUS = 'ACTIVE')
    LOOP
    OWF_MGR.WF_PURGE.MOVE_TO_HISTORY(cur_rec.ITEM_TYPE,cur_rec.ITEM_KEY);
    COMMIT;
    END LOOP;
    END;
    So I am sure that no processes are running before I begin deployment. Thanks again for your reply.

  • How do I load a properties file that is in the same package?

    I have the following package:
    com.company.ldap
    In the package I have:
    main.java
    settings.properties
    I want to load the values in the settings.properties file in code, such as:
    propertiesFile = "settings.properties";
            try {
                properties.load(new FileInputStream(new File(propertiesFile)));
            } catch (IOException e) {
                ... error logging logic ...
            }I keep returning "The system cannot find the file specified".
    How do I properly load a properties file in a class file within the same package?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Put the file in the classpath (such as in the parent directory of com/company/ldap). Then obtain an input stream to that file like this:
    InputStream stream = getClass().getResourceAsStream("/settings.properties");
    Then use that stream in the properties.load method. Remember to close the stream as well.

  • Signing 2 different classes in the same package differently.

    I have a class B in the default package.
    I have another class C which is kept in a jar file without any package information. I have signed this jar file in using one alias in my keystore.
    class B instantiates class C and passes its own reference to it.
    When I run class B, i get an error saying,
    Exception in thread "main" java.lang.SecurityException: class "C"'s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(ClassLoader.java:599)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:532)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    at B.main(B.java:23)
    Does this mean, I cannot have 2 classes in the same package, signed differently?
    Thanks
    AahRiMaaN

    coupdegrace wrote:
    JoachimSauer wrote:
    Force1 wrote:
    Do the files get automatically compiled if they are in the same package ?No, but if the class you compile depends on another that's not yet been compiled (or for which the source is newer than the .class file), then it will be compiled as well.Like,say If i add a int parameter, amethod(int i),then I will get a error,isn't it ?It actually gives a error.
    Also it will compile automatically only for the first time and any changes made to any file will have to be compiled into latest .class files ?Yes.
    Did compile the files under the above constraints.
    So it is a smooth "run" for the first time,but not after editions to the either files.
    I would appreciate if experts give some feedback on this.
    Thank you.

Maybe you are looking for