Can anybody help me to understand this RMI registry service code?

RMI is so difficult to me. please let me know following code what it means.
If this class is instantiated with 50000 port number,
Does RMI Registry Service get started with 50000 port number in place of rmiregistry commands?
And I don't have to execute rmiregistry command?
thanks in advance.
import java.rmi.AccessException;
import java.rmi.AlreadyBoundException;
import java.rmi.NotBoundException;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.registry.Registry;
import java.rmi.server.ObjID;
import java.rmi.server.RemoteServer;
import java.util.Enumeration;
import java.util.Hashtable;
import sun.rmi.server.UnicastServerRef;
import sun.rmi.transport.LiveRef;
* Registry implementation.
* @version 1.0
public class RegistryImpl extends RemoteServer implements Registry {
     private static final long serialVersionUID = -7162736590129110751;
     private Hashtable bindings;
    private static ObjID id = new ObjID(0);
     * @param i port number
     * @throws RemoteException
    public RegistryImpl(int i) throws RemoteException {
        bindings = new Hashtable(101);
        LiveRef liveref = new LiveRef(id, i);
        setup(new UnicastServerRef(liveref));
    private void setup(UnicastServerRef unicastserverref) throws RemoteException {
        super.ref = unicastserverref;
        unicastserverref.exportObject(this, null, true);
     * Lookup a remote object.
     * @param name Name of the remote object.
     * @return Remote object of the specified name.
    public Remote lookup(String name) throws RemoteException, NotBoundException {
//        Logger.debug("NamingService", "lookup: " + name);
        Remote obj;
        synchronized(bindings) {
            obj = (Remote)bindings.get(name);
            if(obj == null)
                throw new NotBoundException(name);
        return obj;
     * Binds the specified name to a remote object.
     * @param name A URL-formatted name for the remote object.
     * @param obj A reference for the remote object (usually a stub).
    public void bind(String name, Remote obj) throws RemoteException, AlreadyBoundException, AccessException {
//        Logger.debug("NamingService", "bind: " + name);
        checkAccess("Registry.bind");
        synchronized(bindings) {
            if(bindings.containsKey(name))
                throw new AlreadyBoundException(name);
            bindings.put(name, obj);
     * Destroys the binding for the specified name that is associated with a remote object.
     * @param name A URL-formatted name for the remote object.
    public void unbind(String name) throws RemoteException, NotBoundException, AccessException {
//        Logger.debug("NamingService", "unbind: " + name);
        checkAccess("Registry.unbind");
        synchronized(bindings) {
            if(!bindings.containsKey(name))
                throw new NotBoundException(name);
            bindings.remove(name);
     * Rebinds the specified name to a new remote object. Any existing binding
     * for the name is replaced.
     * @param name A URL-formatted name for the remote object.
     * @param obj A reference for the remote object (usually a stub).
    public void rebind(String name, Remote obj) throws RemoteException, AccessException {
//        Logger.debug("NamingService", "rebind: " + name);
        checkAccess("Registry.rebind");
        bindings.put(name, obj);
     * Returns an array of the names bound in the registry.
     * @return An array of the names bound in the registry.
    public String[] list() throws RemoteException {
        String[] names;
        synchronized(bindings) {
            int i = bindings.size();
            names = new String;
Enumeration e = bindings.keys();
while(--i >= 0)
names[i] = (String)e.nextElement();
return names;
* TO-DO
public static void checkAccess(String s) throws AccessException {
// check if s is in the list of agents.
if(true)
else
throw new AccessException("");
public static ObjID getID() {
return id;

You don't have any need to understand this code. The complication is due to the registry needing a fixed objectID.
You just need to know the methods of java.rmi.registry.LocateRegistry class. This allows you to start an RMI Registry inside your JVM and give it any TCP port number you like.

Similar Messages

  • I did the iTunes update yesterday and now I am getting this message when I try to open iTunes - "This copy of iTunes is corrupted or is not installed correctly. Please re-install iTunes. (-42037) Can anybody help me out resolving this?

    I did the iTunes update yesterday and now I am getting this message when I try to open iTunes - “This copy of iTunes is corrupted or is not installed correctly. Please re-install iTunes. (-42037) Can anybody help me out resolving this?

    Download iTunes using the tab at the top of this page, re-install.  Back up your computer first.

  • Can anybody help me to troubleshoot this code

    According to this code i must get the same number as o/p. But shift and add seems not functioning well.Can anybody help me to troubleshoot

    Hello Pushpa,
    Thank you for contacting National Instruments.
    Which code are you specifying
    Just make your problem clearly and elaborated
    you can send me your code & If you might want to contact the developer of your application, contact - [email protected]
    Have a great day.
    Regards~
    Mathews
    [email protected]

  • Can anybody help me to understand the CPU usage logs

    Hello community,
    I try to find the faulty machine in our network, but I don`t understand the logfiles. We have many servers which normally work very fast and reliable.
    But sometimes we have such a huge cpu usage drain on our server. Nobody knows where it comes from, so I looked in the vsphere web client and looked in the cpu usage logs.
    Following you can see two pictures. One is from the main host. It shows only a cpu usage of a maximum of 45 %.
    When I look on the vmware machines I can see a cpu usage of more than 150%.
    This is something I completely not understand. How is it possible that the main host machine has only a 45% cpu usage and the clients are exploding?
    I don`t have set a cpu usage limit in our resource pool.
    The next thing is. When I look on the vmmachines, I can not identify the faulty machine. Because when one machine increases the cpu usage many others increase too. Whatever why.
    Can somebody explain me the pictures below please:
    Thank you for your time
    Paul

    You don't have any need to understand this code. The complication is due to the registry needing a fixed objectID.
    You just need to know the methods of java.rmi.registry.LocateRegistry class. This allows you to start an RMI Registry inside your JVM and give it any TCP port number you like.

  • My Ipod doesn't sync songs anymore, can anybody help me out with this?

    Hi all. Yesterday i did a Recovery on my computer and that wiped everything clean off of my computer, including the Itune program that i downloaded. And now, every since i downloaded Itunes again, it won't sync songs into my Ipod anymore. When i would download a few songs into Itunes, I would press on the sync button a message comes up saying that my ipod is synced with another Itunes library and can only be synced with one at a time. This won't let me transfer the songs onto my ipod. When i tryed to sync my songs again another message pops up saying to 'erase and sync'. Meaning that in order for me to sync the new songs onto my ipod, then they are gonna erase all of my existing songs that is currently on my ipod already! I don't wanna do that. I thought about restoring my ipod but i'm afraid that that would erase all of my songs off of my ipod as well.  What do i do? Help would really be appreciated. Thank you. 

    Your iPod is designed to sync with only one iTunes library at a time.  It will recognize the iTunes library on the restored/rolled back PC as a new library.  If you sync the iPod with this new/different library, all content will be erased from the iPod and replaced with what is in the new library.  So what you will want to do is copy everything from the iPod to your new iTunes library on your PC first.
    See this older post from another forum member Zevoneer covering the different methods and software available to assist you with the task of copying content from your iPod back to your PC and into iTunes.
    https://discussions.apple.com/thread/2452022?start=0&tstart=0
    B-rock

  • Can anybody help me to buil this query

    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    ============================
    table1
    ======
    lvl1 lvl2 lvl3 lvl4 value
    ============================
    a b c c1 100
    a b c c2 200
    a e d 30
    table2
    =========
    lvl parenttochild
    ==================
    a 1
    b 2
    e 2
    c 3
    d 3
    c1 4
    c2 4
    can i make it from the above table
    lvl parenttochild value
    =========================
    a 1 330
    b 2 300
    e 2 30
    c 3 300
    d 3 30
    c1 4 100
    c2 4 200

    user5813325 wrote:
    1st two column coming from table 2 and next column-sum of all(a) 330,sum(b)-300 like that way...Not clear with this explanation.
    But still,
    --Sample table
    with table1
    as
    select 'a' lvl1, 'b' lvl2, 'c' lvl3, 'c1' lvl4, 100 value from dual
    union all
    select 'a', 'b', 'c', 'c2', 200 from dual
    union all
    select 'a', 'e', 'd', '', 30 from dual
    ), table2
    as
    select 'a' lvl, 1 parenttochild from dual
    union all
    select 'b', 2 from dual
    union all
    select 'e', 2 from dual
    union all
    select 'c', 3 from dual
    union all
    select 'd', 3 from dual
    union all
    select 'c1', 4 from dual
    union all
    select 'c2', 4 from dual
    -- End of sample table
    -- Main Select
    select t2.lvl, t1.value
      from (
              select decode(no, 1, lvl1, 2, lvl2, 3, lvl3, 4, lvl4) lvl, sum(value) value
                from table1,
                     (select level no from dual connect by level <= 4) -- Number of columns 4
               where decode(no, 1, lvl1, 2, lvl2, 3, lvl3, 4, lvl4) is not null
               group
                  by decode(no, 1, lvl1, 2, lvl2, 3, lvl3, 4, lvl4)
           ) t1
      left
      join table2 t2     
        on t1.lvl = t2.lvl
    --End of main select
    LVL VALUE                 
    a   330                   
    b   300                   
    e   30                    
    c   300                   
    d   30                    
    c1  100                   
    c2  200                   

  • HT201210 i bought a iphone 3g from market yesterday and the phone is showing a usb an also itunes logo on the screen, the ive tryed restore and update, but once this has finished it gives me erra code (1015) can anybody help me plz

    i bought a iphone 3g from market yesterday and the phone is showing a usb an also itunes logo on the screen, the ive tryed restore and update, but once this has finished it gives me erra code (1015) can anybody help me plz

    Error 1015: This error is typically caused by attempts to downgrade the iPhone, iPad, or iPod touch's software. This can occur when you attempt to restore using an older .ipsw file. Downgrading to a previous version is not supported. To resolve this issue, attempt to restore with the latest iPhone, iPad, or iPod touch software available from Apple. This error can also occur when an unauthorized modification of the iOS has occurred and you are now trying to restore to an authorized, default state.
    http://support.apple.com/kb/TS3694#error1015.

  • Itunes 64 bit wont install on my Dell XPS due to Windows Installer problems. Can somebody help me out with this?

    I have Windows 7 home premium, running on a Dell XPS 15, with 64 bit OS, and when i went to install itunes for my new phone, it would almost install, but then say that it couldn't install due to issues with windows Installer. has anybody had this happen to them? can anybody help me out with this?

    Many thanks.
    "There is a problem with this Windows Installer Package. A program required for this install to complete could not be run. Contact your support personnel or package vendor".
    Perhaps let's first try updating your Apple Software Update.
    Launch Apple Software Update ("Start > All Programs > Apple Software Update"). Does it launch and offer you a newer version of Apple Software Update? If so, choose to install just that update to Apple Software Update. (Deselect any other software offered at the same time.)
    If the ASU update goes through okay, try another iTunes install. Does it go through without the errors this time?

  • Can anybody tell me the exact use of "SQVI" T-Code in SAP

    Hi,
    Can anybody help me the exact purpose of "SQVI" t-code with one example of scenario to understand.
    Regards,
    Prasad.

    Here is the extra code: ( I had to take out the arrows)
    TR
    TH ALIGN="LEFT" style="background-color:#C0C0A0> /TH
    TH ALIGN="LEFT" style="background-color:#C0C0A0"> /TH
    TH ALIGN="LEFT" style="background-color:#C0C0A0"> /TH
    TH ALIGN="LEFT" stye="background-color:#C0C0A0"> /TH
    TH ALIGN="LEFT" style="background-color:#C0C0A0"> /TH
    /TR

  • My ipad just won't let me enter my apple password on FaceTime or iMessage, it works fine on my iPhone, I have tried numerous things but nothing works, can anybody help please, will a bug fix sort this out when they finally make one

    My ipad just won't let me sign in with my apple password on FaceTime or iMessage since updating to ios7 it says check my network connection, even though my iPhone works fine with the same password, can anybody help please, I have tried numerous things but nothing  works.  Will I have to wait for a bug fix to sort this? I hear they are working on one a the minute, I hate ios7

    Try a Restart.
    Press and hold the Sleep/Wake button for a few seconds until the red "slide to power off" slider appears, and then slide the slider. Press and hold the Sleep/Wake button until the Apple logo appears.
    Resetting your settings
    You can also try resetting all settings. Settings>General>Reset>Reset All Settings. You will have to enter all of your device settings again.... All of the settings in the settings app will have to be re-entered. You won't lose any data, but it takes time to enter all of the settings again.
    Resetting your device
    Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears. Apple recommends this only if you are unable to restart it.
    Or if this doesn't work and nobody else on the blog doesn't have a better idea you can contact Apple.
    Here is a link to their contacts with most of the information below.
    http://www.apple.com/contact/

  • I'm using iphoto9.1.3 but now it doesn't seem to work, whenever I try to open it, it just shows loading, but never loads. Can anybody help me with this ?

    I'm using iphoto9.1.3 but now it doesn't seem to work, whenever I try to open it, it just shows loading, but never loads. Can anybody help me with this ?    

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Can anybody help me set this code into an array?

    Thanks, can you help me understand how to make an array work?
    I need to fade toggle a different country png for each country button and fade out the rest of the country images i.e.: when i click the UK button i need to fade toggle the UK png and fade out the other countries
    when i click the USA button i need to fade toggle the USA ing and fade out the other countries and so on
    sym.getSymbol("Countries").$("UK").fadeToggle();sym.getSymbol("Countries").$("USA","AUS","Hongkong","Switzerland","Ireland","Indias","Japa n","Netherlands","Spain").fadeOut();
    sym.getSymbol("Countries").$("USA").fadeToggle();sym.getSymbol("Countries").$("UK","AUS","Hongkong","Switzerland","Ireland","Indias","Japan ","Netherlands","Spain").fadeOut();
    etc
    but it doesn't seem to work how i have it and i have been told to do an array but I'm not sure how?
    Project here if you want to have a look:
    Dropbox - Countries.zip
    can you help?

    I think this[var = sym.getSymbol (Stanbuttons).$(".UK_stan, .USA_stan"); ] should be
    var myvar = sym.getSymbol (Stanbuttons).$(".UK_stan, .USA_stan");
    And than
    myvar.each(function(){
    $(this).fadeOut();

  • Hi want to convert a number in crore, e.g. 10000000 to 1.00 Can anybody help on this?

    Hi All,
    I want to convert a number in crore format.
    My basic problem is, I am using a custome format:
    #,##0.00,,,%;
    Here main task is done by ,,,%.
    Each comma (,) is dividing a number by 1000. Thus three commas are dividing a number by 10^9 digits.
    But I need number in crore (i.e. 10^7), Thus we have used this percent sign (%).
    Here I can get required Value but appended percent (%) to it. I can temporary hide this using wrap text.
    But I need exact solution to convert a number in crore.
    Can anybody help me regarding the same.

    Hi Neha,
    You can use EPMScaleData function, in that give scaling factor as per your requirement.
    For more details you can go through following link
    How to use EPMScaleData in a fully dynamic report
    Regards,
    Shrikant

  • I am trying to instal the latest version of iTunes onto my MacBook Pro, but my computer has been "configuring" the installation since 5pm yesterday and now it is 10:30am. It has never done this before. Can anybody help me out?

    I am trying to instal the latest version of iTunes onto my MacBook Pro, but my computer has been "configuring" the installation since 5pm yesterday and now it is 10:30am. It has never done this before. Can anybody help me out?

    Many thanks b Noir
    This is a copy of ONEof the keys  in the registry I changed  as told by Apple support today. I also have changed others as instructed by GEAR  software support to manually delete GEAR drivers (that I had installed but couldn't delete some of the others  they mentioned from Windows system 32. Then some bright spark at work told me I need the Gear drivers so  I downloaded the software and installed again.
    Sorry, just this minute went to insert image  and it is giving me a message saying this sort of content  is not allowed?.
    The most recent key I altered is in: HKey _local _machine. System\class - 4D36E965-E325-11CEBFC1-08002BE10318. Upper Filter data: Upper filter NTIDrvr  SiRem GEARAspiWDN.
    The GEARsoftware info about manually deleting  GEAR drive is from:
    http://www.gearsoftware.com/wiki/index.php?title=DRIVERS:_Windows_-_Updating%2C_ removing%2C_64_bit_versions%2C_etc
    I hope you can help

  • I get an error message when trying to email photos. It says "The email server didn't recognize your username/password combination." Yet I have reset my password and was able to log in to this Support Community. Can anybody help me?

    I get an error message when trying to email photos. It says "The email server didn't recognize your username/password combination." Yet I have reset my password and was able to log in to this Support Community. Can anybody help me?

    See my answer to your previous duplicate question. What happened when you tried my answers?
    LN

Maybe you are looking for

  • I can't save files anymore after upgrading to iOS8. Do I have too many on my iPad?

    I'm a heavy Photoshop Touch user, with the last version of the app and iOS 8 on an iPad Air, and lately I often can't save the files I've been working on: the app suddenly quits as soon as I try to save the often multilayered image, but also lighter

  • Adobe photoshop elements 10 uninstalled itself.

    Adobe Photoshop elements 10 uninstalled itself.  Any ideas?

  • How to remove/uninstall custom installed perl modules?

    Hello all. Yesterday I upgraded from 10.3.7 to 10.4.5, then started to reinstall a bundle of perl modules (via the Terminal and 'perl Makefile.PL -- make -- make test -- [sudo] make install'). As I saw too late, some of those modules I installed are

  • Simulating the resources in XML schema

    I am looking for an approach to simulate the Resource (Resources) in the XML schemas such that in the absence of the resource, the adapter will be hooked to this Flat File system, and performs all required adapter functionalities

  • Loading Missing data

    Hi folks, We are with BW 3.x.  One of the Info Sources (2LIS_11_VAITM) which has sales orders information is fed from SAP R/3 through IDocs, it uses delta machanism. One day we had an issue due to password (user ALEREMOTE), the dataload to BW failed