Iterating through available virtual servers...

Hello,
I am writing a NSAPI filter on Sun ONE Web Server 6.1. Can someone point me to the docs that describe how one could programmatically iterate through all the virtual servers/sites, associated port numbers, etc., using Sun's C/C++ API?
Thanks!

No, there is no API for iterating over virtual servers. An NSAPI plugin typically is not aware of virtual servers. An NSAPI plugin that needs to be virtual server aware can register itself to receive virtual server creation and destruction events using the documented vs_register_cb() function.
There is no API for parsing/modifying server.xml.

Similar Messages

  • Can I use virtual Servers in private cloud for RAC

    Hello  to all
    We are going to install an Oracle RAC on two servers
    But our Hardware Administrator says to us   “I Allocate two virtual servers in the our private cloud not two physical Servers (or real Servers)”
    Do you think it’s practical and reasonable to using virtual Server for Oracle RAC  in production environment ?
    Which one is better physical server or virtual server  for RAC?
    Please write your reasons
    Thanks

    Using virtual machines is officially  supported for RAC only in a few cases which can be found here:
    http://www.oracle.com/technetwork/database/virtualizationmatrix-172995.html
    Make sure that you meet these requirements in your private cloud. Some cases like vmware are still somewhat supported despite beeing not on the list.
    Beside this you should make sure that your 2 virtual machines run on different hardware servers in the cloud, otherwise you lose most parts of the rac advantage regarding high availability, when both virtual servers happen to run on the same hardware during a crash
    Virtual servers are used in production environments, but you will have to take greater care for many aspects of rac compared to physical hardware, e.g.. something like "live migration" of vmware can kill a rac node due to timeout.
    I would prefer hardware for rac anytime over virtual servers and spare me the hassle of dealing with all possible issues arising from the virtualization.
    And check oracles licensing policy...
    Running an enterprise edition rac on e.g. a large vmware cluster is insanely expensive, you pay every cpu core the rac COULD run on -> the entire cluster!
    If you must use virtual hardware but don't want to and need an argument against it use the license issue.
    Regards
    Thomas

  • Highly Available Management Servers in SCVMM 2012

    Dear All,
                I need to build Highly Available Management Servers (2) (SCVMM 2012) for my environment.  I am interested in following things:
    1.  What are my options.  I have done little reading and seek confirmation that without building a windows failover cluster, one is not able to build HA SCVMM Management Servers?  Am I correct in understanding this?  If so, do I need
    a shared disk as well to create a cluster first and then install Management Servers? 
    2.  What service accounts or groups are need during the configuration and what would be their permissions on respective servers such as Hyper-V Hosts and in Active Directory?
    3.  Do we really need to create a container in Active Directory for an HA SCVMM scenario?
    4.  Can HA solution be implemented without the WFC?
    5.  Would appreciate, if you could share some of the links to blogs/articles about step by step instructions to it.
    Thanks in advance.

    easy.  create 2 node  cluster-nested virtual or physical, no matter.  if virtual, set affinity (rather lack of to keep them on separate nodes-also build  a sql cluster as well and also keep them on separate nodes)follow the articles. 
    I found no less than 10 step by steps when searching for when I built the HA SCVMM / SQL environment for my company.
    MS article and third party, as you can see they are pretty straight forward to follow.  Best of luck.
    http://technet.microsoft.com/en-us/library/gg610678.aspx
    http://www.thomasmaurer.ch/2013/08/how-to-install-a-highly-available-scvmm-management-server/
    Brian

  • Moving EP to Virtual Servers

    Hello Guys,
    We are in the process of moving our servers to Virtual Servers with our Service Providers and our EP 5.0 server is also part of it. I wanted to know whether SAP supports Virtual Servers for EP and if yes what care should we be taking.
    Any help on this would be highly appreciated. Also if you can point me to the right direction then it would be great.
    Regards,
    Piyush Gandhi

    Hi,
    EP as part of Netweaver is available for Virtualization.
    As a good starting point for you i will suggest these two threads:
    The specified item was not found.
    VMware documents regarding SAP products
    Regards
    Franz
    Edited by: Franz Hiltscher on Jun 17, 2010 1:29 PM

  • Virtues of virtual servers ???

    Hi all: I am less than up-to-date on virtual machines in regards to OES servers. What are the benefits of running multiple VM servers on the same hardware rather than running one server natively with many services? On the one hand I can see efficiencies by keeping the hardware busy and that VM servers can be very specialized. On the other hand hardware failure can result in a world of hurt if all your VMs go down at once.
    Thanks, Chris.

    Chris wrote:
    > Thanks for the reply. Regarding hardware failure, I could use my current
    > configuration as a good example. We have 5 OES servers as a result of a
    > design decision made many years ago; have several servers, each doing one
    > or two things, so that if any one server goes down we don not loss all
    > network services. With this configuration, if one server suffers a
    > catastrophic failure (say a backplane fails) I can maintain most other
    > services.
    >
    > Now if I were to have one VM host running five VMs so that no one VM runs
    > more than one or two services, I have the same separation of services.
    > However, the difference being if my host now suffers a catastrophic
    > failure, I loss all the VMs and all services. I am not saying this is
    > likely, but it is something I would worry about.
    >
    > I do like the many other benefits of VMs pointed out in other thread
    > responses, and they many in fact out-weigh the downside.
    >
    >>>> KBOYLE<[email protected]> 2/19/2013 3:38 PM >>>
    > Chris wrote:
    >
    >> On the other hand hardware failure can result in a world of hurt if
    >> all your VMs go down at once.
    >
    > If you mean that you /could/ have multiple corrupted servers to repair,
    > then I would agree with you but proper backups should mitigate that
    > risk. Whether all your services are on a single physical server or
    > spread across multiple virtual servers, the result of a hardware
    > failure is essentially the same.
    >
    > Multiple virtual servers allow you to isolate servers/services and even
    > install mutually exclusive OES services on the same box.
    >
    > --
    > Kevin Boyle - Knowledge Partner
    > If you find this post helpful and are logged into the web interface,
    > show your appreciation and click on the star below...
    The only way to safely run vm's is to use High availability with a san. I
    have been doing so now for quite a while and would not turn back. I prefer
    to use a san for redundancy. It has been very reliable and using raw disks
    off the san for vm's I don't see the impact that see running say off of an
    ocfs disk with image files.
    Just my 2 cents.
    Rick

  • Virtual servers are rebooting automatically

    Hello All,
    I am having an issue with Virtual Servers.
    I have 5 node cluster. Last week due to storage firmware upgradation we had some problems. after that we contacted storage expert and get it rectified. Now One of cluster node is having a issue. Once i move the VMs (This node is the owner of VMs) then the
    virtual servers are automatically rebooting. Now this node is ideal. In addition to that we checked all updates and run the failover test also..every thing is showing green.
    Can any one have solution for this, please help me.
    Thank you.
    Karan

    Hi Karan,
    Unfortunately, the available information is not enough to have a clear view of the occurred behavior. Could you provide more information about your environment. For example,
    the exact text of any error messages that you received that are associated with this problem? 
    The server version of the problem on, when you experience this issue what are you trying to do, when this problem occurs the system log record information, screenshots is the best information.
    The 1146 event just can offer us the cluster fail, but we still need more information, please post your cluster log. You can refer the following article to generate the cluster
    log.
    How to create the cluster.log in Windows Server 2008 Failover Clustering
    http://blogs.msdn.com/b/clustering/archive/2008/09/24/8962934.aspx
    If you are using 2008r2 cluster please install the Recommended hotfixes and updates for Windows Server 2008 R2 SP1 Failover Clusters updates then monitor this issue again.
    http://support.microsoft.com/kb/2545685
    More information:
    Event Logs
    http://technet.microsoft.com/en-us/library/cc722404.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • High Available virtual machines-SAN storage availability

    Hi,
    Considering that we have the following scenarios:
    1) High available virtual machines
    2)Storage presented through a virtual SAN switch connection.
    The question that I have for you is the following:
    How will the SAN storage be available to the virtual machines in:
    a) Life-migration scenarios?
    b)Physical server failure?
    Thank you.

    Hi,
    a) from Technet:
    You must have access to any virtual SANs that are being used by the virtual machine. In addition, the virtual SAN connectivity must have the same number of ports on the SAN to expose the LUNs"
    http://technet.microsoft.com/en-us/library/dn551169.aspx#BKMK_Step1
    b) A classcial Failover will occur and all cluster resources will be moved to another cluster node depending on your configured Failover Cluster rules
    regards Marc Grote aka Jens Baier - www.it-training-grote.de - www.forefront-tmg.de - www.galileocomputing.de/3570

  • Oracle has not certified Hyperion products on virtualized servers

    Hyperion's official stance:
    Oracle has not certified Hyperion products on virtualized environments;
    I'm surprised that there are users in this forum who are using VMware instead of physical servers. If you run into a bug, Oracle tech support require you to replicate that bug in physical servers before they will help you.
    Also, consultants tell us that data has been known to be lost by virtual servers.
    Has anyone good results from running Planning and Essbase on VMware?

    Thats right I dont personally have access to Metalink2.
    I found a statement on Metalink3:
    Click the knowledge tab, go to Advanced Search, tick all sources and in the Doc ID field enter 588303.1. Hit Search!
    You get the following statement:
    Hyperion Essbase
    Goal
    Describe support for Oracle's Hyperion Products in virtualized environments.
    Solution
    Oracle has not certified Hyperion products on third-party virtualized environments; however, Oracle Support will assist customers running Oracle’s Hyperion products on third-party virtualized environments as follows:
    When a customer logs a previously unreported issue, Oracle Support may require the issue to be diagnosed in a non-virtualized environment when there is reason to believe that the virtual environment is a contributing factor. Oracle Support may refer customers to the third-part virtualization vendor for issues that can not be duplicated in non-virtualized environments.
    When a problem has been previously reported and a resolution is available, Oracle support will recommend the appropriate solution on the non-virtualized OS. If that solution does not work in the virtual environment, the customer will be referred to their virtualization software vendor for support. If the customer demonstrates that the Oracle solution does not work when running on a non-virtualized OS, Oracle will resume support, including logging a bug with Oracle Development for investigation if required.
    While Oracle’s Hyperion products are expected to function properly in virtual environments, there may be performance implications, which can invalidate Oracle’s typical sizing recommendations. An analysis should be performed within the context of the specific application to be hosted in the virtual environment to mitigate potential resource contention, as this can result in degradation of performance and scalability, particularly under peak load.
    For further information on support for Hyperion products running on Oracle VM, please see Note 466538.1 and Note 464754.1 in MetaLink2 (a href="https://metalink.oracle.com)
    Hope this helps.
    Seb

  • Cannot get my iphone5 to synch with my new computer. i am running itunes through a virtual box, Every time I try a box appeares telling me to enter security code- ? anyone know how to solve this ?

    Cant get my iphone 5 to sync with my computer (new operating system). Am running XP through a virtual box. When I try to sync the phone it keeps asking for auto lock code, there is no box to type it into and I can find nothing on the phone itself to solve the problem.
    This makes it impossibble to sync with my itunes account. Anyone out there able to help ?

    Have you tried contactint the app's developer?

  • Issue on virtual servers on sun one web server

    Hi all,
    I configured sun webserver 6.1 sp8 on windows 2003 server
    I configured php,asp,jsp succesfully on different virtual servers.
    as
    www.abc.com:80
    www.php.com:2222
    www.asp.com:3333
    www.jsp.com:4444
    Now the issue is
    I want to run the applications by using url with out portno in the browser
    like www.php.com instead of www.php.com:2222
    my DNS is aware of the www.abc.com,www.php.com,asp.com,jsp.com
    From Internet I can access www.abc.com:80 as www.abc.com becoz it is running on port 80.
    If I type www.php.com it is directing to www.abc.com not to www.php.com:2222.
    In the host file under windows/system32/drivers/etc I added the following lines
    10.129.149.196 www.abc.com
    10.129.149.196 www.php.com
    10.129.149.196 www.asp.com
    10.129.149.196 www.jsp.com
    I want to run the applications without entering portno along with url in the browser.
    Can any one help me please.
    Thanks in advance

    Dear M.V,
    I choose one server(www.xyz.com) that is running on port 80,in its server.xml I added
    <VS id="https-pqr" connections="ls1" mime="mime1" aclids="acl1" urlhosts="www.pqr.com" state="on">
    <PROPERTY name="docroot" value="D:/Sun/WebServer6.1/docs"/>
    <USERDB id="default"/>
    <SEARCH>
    <WEBAPP uri="/search" path="D:/Sun/WebServer6.1/bin/https/webapps/search" enabled="true"/>
    </SEARCH>
    <WEBAPP uri="/" path="D:/Sun/WebServer6.1/https-pqr/webapps/https-pqr" enabled="true"/>
    </VS>
    which is of pqr virtual server that is running on port 3333
    Now with out port no ie, with www.pqr.com I am able to see the home page of application running on pqr virtual server.
    With this configuration I need to check at client environment
    If u find mistakes from the above configuration please let me know
    Thanks alot
    Bye

  • Best practices for setting up virtual servers on Windows Server 2012 R2

    I am creating a Web server from scratch with Windows Server 2012 R2. I expect to have a host server, and then 3 virtual servers...one that runs all of the web apps as a web server, another as a Database Server, and then on for session state.  I
    expect to use Windows Server 2012 R2 for the Web Server and Database Server, but Windows 7 for the session state.
    I have an SATA2 Intel SROMBSASMR RAID card with battery back up that I am attaching a small SSD drive that I expect to use for the session state, and an IBM Server RAID M1015 SATA3 card that I am running Intel 520 Series SSD's that I expect to
    use for Web server and Database server.
    I have some questions. I am considering using the internal USB with a flash drive to boot the Host off of, and then using two small SSD's in a Raid 0 for the Web server (theory being that if something goes wrong, session state is on a different drive), and
    then 2 more for the Database server in a RAID 1 configuration.
    please feel free to poke holes in this and tell me of a better way to do it.
    I am assuming that having the host running on a slow USB drive that is internal has no effect on the virtual servers after it is booted up, and the virtual servers are booted up?
    DCSSR

    I am creating a Web server from scratch with Windows Server 2012 R2. I expect to have a host server, and then 3 virtual servers...one that runs all of the web apps as a web server, another as a Database Server, and then on for session state.  I
    expect to use Windows Server 2012 R2 for the Web Server and Database Server, but Windows 7 for the session state.
    I have an SATA2 Intel SROMBSASMR RAID card with battery back up that I am attaching a small SSD drive that I expect to use for the session state, and an IBM Server RAID M1015 SATA3 card that I am running Intel 520 Series SSD's that I expect to
    use for Web server and Database server.
    I have some questions. I am considering using the internal USB with a flash drive to boot the Host off of, and then using two small SSD's in a Raid 0 for the Web server (theory being that if something goes wrong, session state is on a different drive), and
    then 2 more for the Database server in a RAID 1 configuration.
    please feel free to poke holes in this and tell me of a better way to do it.
    I am assuming that having the host running on a slow USB drive that is internal has no effect on the virtual servers after it is booted up, and the virtual servers are booted up?
    There are two issues about RAID0:
    1) It's not as fast as people think. So with a general purpose file system like NTFS or ReFS (choice for Windows is limited) you're not going to have any great benefits as there are very low chances whole RAID stripe would be updated @ the same time (I/Os
    need to touch all SSDs in a set so 256KB+ in a real life). Web server workload is quite far away from sequential reads or writes so RAID0 is not going to shine here. Log-structures file system (or at least some FS with logging capabilities, think about ZFS
    and ZIL enabled) *will* benefit from SSDs in RAID0 properly assigned. 
    2) RAID0 is dangerous. One lost SSD would render whole RAID set useless. So unless you build a network RAID1-over-RAID0 (mirror RAID sets between multiple hosts with a virtual SAN like or synchronous replication solutions) - you'll be sitting on a time bomb.
    Not good :)
    StarWind VSAN [Virtual SAN] clusters Hyper-V without SAS, Fibre Channel, SMB 3.0 or iSCSI, uses Ethernet to mirror internally mounted SATA disks between hosts.

  • How to customize search in WS 7 and for multiple virtual servers?

    I'm not clear on how to customize search results pages in Sun Web Server 7. The documentation (the Adminstrator's Guide, page 215) says:
    You can take a look at the default search application located at /bin/https/webapps/search as a sample application
    but I'm not seeing any such thing. I did a find . -name search -type d from the server root and instance root but the only search directories I'm seeing are subdirectories within the generated directory and they look like system generated jsps that I shouldn't touch (So I didn't :-)
    So one question is, where is the default app? A second question is, how do we set up different branding for different virtual servers?
    We're currently using WS 6.1 and it has a field in the GUI for the directory containing the web app to use for search. That seems to have disappeared in WS 7.
    Any help would be appreciated. Thanks.
    Dave

    I don't use the search engine, so I'm afriad I don't have direct experience here.
    What I'd probably do is modify the app so that it looks at the Host data to determine which directory it should point to for graphics, formatting, etc. You could also use the obj.conf with variables to pull graphics from directories appropriately branded. Something like:
    1) Create "additional doc directory" for images
    2) Find the entry in the obj.conf that points to the new directory
    3) Modify the path to something like /path/to/$host/images
    4) Make sure you create directories like:
    /path/to/foobar.com/images/
    /path/to/www.foobar.com/images/
    /path/to/baz.com/images/
    /path/to/www.baz.com/images/

  • SharePoint Online Iterating through Document Libraries CSOM

    Hi,
    I am trying to iterate though a document library and set each document/items whithin to inherit permissions (at the moment each doc/item is using uniquer permissions).
    I am able to get the specific document library that I am interesting in, however I cannot at the moment iterate though each of the items/documents within it, but here is what I have so far:
    Add-Type -Path "Libraries\Microsoft.SharePoint.Client.dll"
    Add-Type -Path "Libraries\Microsoft.SharePoint.Client.Runtime.dll"
    Add-Type -Path "Libraries\Microsoft.SharePoint.Linq.dll"
    Add-Type -Path "Libraries\Microsoft.SharePoint.dll"
    $webUrl = "https://test.sharepoint.com/sites/testsite"
    $username = "####"
    $password = "####"
    $securePass = ConvertTo-SecureString $password -AsPlainText -Force
    $listname = "TestDoc";
    $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl)
    $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $securePass)
    #variables
    $web = $ctx.Web
    $lists = $web.Lists
    $ctx.Load($lists)
    $ctx.Load($web)
    $ctx.ExecuteQuery()
    #print web URL
    write-host `n "Web Url:" `n $web.Url
    foreach ($list in $lists)
    if ($list.Title -eq "TestDoc")
    #print list name if found
    write-host `n "Found the list:" `n $list.Title `n
    #attempting to iterate through items in the document library
    foreach ($item2 in $list.Items)
    #list the items/documents in the document library
    write-host $item2.Title
    It is the foreach loop I am having trouble at the moment as I am not sure how to loop though each of the items/documents in the document library.
    Any suggestions on the approach I should take would be much appreciated.

    Thanks for the heads up, I have re-worked my script which is simpler and now works like a charm:
    Add-Type -Path "Libraries\Microsoft.SharePoint.Client.dll"
    Add-Type -Path "Libraries\Microsoft.SharePoint.Client.Runtime.dll"
    Add-Type -Path "Libraries\Microsoft.SharePoint.Linq.dll"
    Add-Type -Path "Libraries\Microsoft.SharePoint.dll"
    $webUrl = "https://test.sharepoint.com/sites/testsite"
    $username = "####"
    $password = "####"
    $securePass = ConvertTo-SecureString $password -AsPlainText -Force
    $listname = "TestDoc"
    $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl)
    $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $securePass)
    #get the List/DocLib and load it for use
    $listUpdate = $ctx.Web.Lists.GetByTitle($listname)
    $ctx.Load($listUpdate)
    $ctx.ExecuteQuery()
    #CAML Query to get all items inclusing sub-folders
    $spQuery = New-Object Microsoft.SharePoint.Client.CamlQuery
    $spQuery.ViewXml = "<View Scope='RecursiveAll' />";
    $itemki = $listUpdate.GetItems($spQuery)
    $ctx.Load($itemki)
    $ctx.ExecuteQuery()
    #iterating through the items and reseting permission inheritence
    for($j=0; $j -lt $itemki.Count; $j++)
    $itemki[$j].ResetRoleInheritance()
    $ctx.ExecuteQuery()

  • Avoid iterating through everything

    Hello all,
    Hope you guys can help me with this problem. I have a program that draws anywhere from 1-300,000 letters on a canvas. Each letter is created from a class called StringState which extends Rectangle. What I would like to do is have each letter respond when the user moves the mouse over the letter by growing bigger. I figured I can just see if the letters bounds contains the point where the mouse moved to and if it does change the letters size and repaint around that letter to update the display. This works great from 1-5000 letters but getting up to 10,000 or even higher creates a very visible lag while the program is iterating through the letters to check if the mouse location intersects the letters bounds. What I was wondering is there a way to get this result without iterating through the entire collection of letters to see if it contains the mouse location? Like can I attach some kind of mouse listener to each letter or something like that? The following program just demonstrates how I create and display the letters I haven't really had a chance to create a demonstration of how they would grow when hovered over. The program i'm working on that actually demonstrates this is very large and hard to trim down to show an example so the following code is actually from a previous question I asked and was provided by Aephyr. Thanks in advance for your guys help :)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import java.util.List;
    public class PaintSurface implements Runnable, ActionListener {
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new PaintSurface());
         Tableaux tableaux;
         Random random = new Random();
    //        Point mouselocation = new Point(0,0);
         static final int WIDTH = 1000;
         static final int HEIGHT = 1000;
            JFrame frame = new JFrame();
         public void run() {
              tableaux = new Tableaux();
              for (int i=15000; --i>=0;)
                   addRandom();
              frame.add(tableaux, BorderLayout.CENTER);
              JButton add = new JButton("Add");
              add.addActionListener(this);
              frame.add(add, BorderLayout.SOUTH);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setSize(WIDTH, HEIGHT);
              frame.setLocationRelativeTo(null);
    //                frame.addMouseMotionListener(new MouseListener());
              frame.setVisible(true);
         public void actionPerformed(ActionEvent e) {
              addRandom();
         void addRandom() {
              tableaux.add(
                        Character.toString((char)('a'+random.nextInt(26))),
                        UIManager.getFont("Button.font"),
                        random.nextInt(WIDTH), random.nextInt(HEIGHT));
    //        class MouseListener extends MouseAdapter {
    //            public void mouseMoved(MouseEvent e) {
    //                mouselocation = new Point(e.getX(),e.getY());
    //                frame.repaint();
            class StringState extends Rectangle {
                    StringState(String str, Font font, int x, int y, int w, int h) {
                            super(x, y, w, h);
                            string = str;
                            this.font = font;
                    String string;
                    Font font;
            class Tableaux extends JComponent {
                 Tableaux() {
                      this.enableEvents(MouseEvent.MOUSE_MOTION_EVENT_MASK);
                      lagState = createState("Lag", new Font("Arial",Font.BOLD,20), 0, 0);
                 protected void processMouseMotionEvent(MouseEvent e) {
                      repaint(lagState);
                      lagState.setLocation(e.getX(), e.getY());
                      repaint(lagState);
                      super.processMouseMotionEvent(e);
                 StringState lagState;
                    List<StringState> states = new ArrayList<StringState>();
                    StringState createState(String str, Font font, int x, int y) {
                        FontMetrics metrics = getFontMetrics(font);
                        int w = metrics.stringWidth(str);
                        int h = metrics.getHeight();
                        return new StringState(str, font, x, y-metrics.getAscent(), w, h);
                    public void add(String str, Font font, int x, int y) {
                         StringState state = createState(str, font, x, y);
                            states.add(state);
                            repaint(state);
                    protected void paintComponent(Graphics g) {
                            Rectangle clip = g.getClipBounds();
                            FontMetrics metrics = g.getFontMetrics();
                            for (StringState state : states) {
                                    if (state.intersects(clip)) {
                                            if (!state.font.equals(g.getFont())) {
                                                    g.setFont(state.font);
                                                    metrics = g.getFontMetrics();
                                            g.drawString(state.string, state.x, state.y+metrics.getAscent());
                            if (lagState.intersects(clip)) {
                            g.setColor(Color.red);
                            if (!lagState.font.equals(g.getFont())) {
                                g.setFont(lagState.font);
                                metrics = g.getFontMetrics();
                            g.drawString("Lag", lagState.x, lagState.y+metrics.getAscent());
    }Here is the code that iterates through the letters to see if a letter contains the mouse location:
                if(e.getSource()==canvas&&edit) {
                    for(Letter l : letters) {
                        Rectangle rec = new Rectangle(l.x+l.xoffset,l.y+l.yoffset,l.width,l.height);
                        if(rec.contains(new Point(e.getX(),e.getY()))&&l.resizing==false&&l.defaultSize==l.font.getSize()) {
                            l.resizing = true;
                            new Thread(new ExpandLetter(l)).start();
                        else if(!rec.contains(new Point(e.getX(),e.getY()))&&l.resizing==false){
                            l.font = new Font(l.font.getName(),l.font.getStyle(),l.defaultSize);
                            l.resizeLetter(l.text);
                }However I just learned that this loop itself is taking up a huge amount of memory by saying
    l.font = new Font(l.font.getName(),l.font.getStyle(),l.defaultSize); When I take that line out the lag is reduced by a lot. Also I think that it isn't forgetting the "old" letters font that it is replacing by saying new Font() and after running this loop once my program runs slow and laggy as if it doesn't have enough memory to run fast anymore. Is there something I am doing wrong by initiating a new Font. I would have thought that it wouldn't take up anymore memory because it replaces the old font the the letter "l" has. The loop seems to have some kind of memory leak if someone could point it out to me that would be great. Thanks :)
    Edited by: neptune692 on Feb 16, 2010 8:18 PM

    neptune692 wrote:
    can I attach some kind of mouse listener to each letterTry this:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import java.util.*;
    import javax.swing.event.*;
    public class SimplePaintSurface implements Runnable, ActionListener {
        private static final int WIDTH = 1250;
        private static final int HEIGHT = 800;
        private Random random = new Random();
        private JFrame frame = new JFrame("SimplePaintSurface");
        private JPanel tableaux;
        public void run() {
            tableaux = new JPanel(null);
            for (int i = 15000; --i >= 0;) {
                addRandom();
            frame.add(tableaux, BorderLayout.CENTER);
            JButton add = new JButton("Add");
            add.addActionListener(this);
            frame.add(add, BorderLayout.SOUTH);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(WIDTH, HEIGHT);
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
            tableaux.requestFocusInWindow();
        public void actionPerformed(final ActionEvent e) {
            addRandom();
            tableaux.repaint();
        void addRandom() {
            Letter letter = new Letter(Character.toString((char) ('a' + random.nextInt(26))));
            letter.setBounds(random.nextInt(WIDTH), random.nextInt(HEIGHT), 16, 16);
            tableaux.add(letter);
        public static void main(final String[] args) {
            SwingUtilities.invokeLater(new SimplePaintSurface());
    class Letter extends JLabel {
        Font font1;
        Font font2;
        private final FontRenderContext fontRenderContext1;
        private final FontRenderContext fontRenderContext2;
        public Letter(final String letter) {
            super(letter);
            setFocusable(true);
            setBackground(Color.RED);
            font1 = getFont();
            font2 = font1.deriveFont(48f);
            fontRenderContext1 = getFontMetrics(font1).getFontRenderContext();
            fontRenderContext2 = getFontMetrics(font2).getFontRenderContext();
            MouseInputAdapter mouseHandler = new MouseInputAdapter() {
                @Override
                public void mouseEntered(final MouseEvent e) {
                    Letter.this.setOpaque(true);
                    setFont(font2);
                    Rectangle bounds = getBounds();
                    Rectangle2D stringBounds = font2.getStringBounds(getText(), fontRenderContext2);
                    bounds.width = (int) stringBounds.getWidth();
                    bounds.height = (int) stringBounds.getHeight();
                    setBounds(bounds);
                @Override
                public void mouseExited(final MouseEvent e) {
                    Letter.this.setOpaque(false);
                    setFont(font1);
                    Rectangle bounds = getBounds();
                    Rectangle2D stringBounds = font1.getStringBounds(getText(), fontRenderContext1);
                    bounds.width = (int) stringBounds.getWidth();
                    bounds.height = (int) stringBounds.getHeight();
                    setBounds(bounds);
            addMouseListener(mouseHandler);
    }

  • Running SAP on Microsoft Virtual Servers

    Is anyone running SAP on Microsoft Virtual Servers?  If so, what has been your experience with this?  We are installing NetWeaver 2004s on three virtual servers (running on the same Physical Windows server). We are using the Microsoft Virtual Server software (not VM Ware).
    Thanks in advance for any information.

    Check Note 674851 - Virtualization on Windows:
    VMware, GSX Server, VMware workstation, Microsoft Virtual Server
    Due to their restriction to 32-bit, single CPU and host/guest operation, these virtualization products are not suitable for productive SAP applications.
    It may be advisable to use one of these products to operate non-production systems (demo systems, test systems, development systems and so on).
    I would not use Microsoft Virtual Server for productive installations, additionally, depending on the database used, it may or may not supported by the database vendor and thus also may or may not supported by SAP.
    In worst case you will need to reinstall the application on a non-virtualized environment and reproduce a problem there before SAP support will accept the problem.
    Markus

Maybe you are looking for