Search Results

Search found 312 results on 13 pages for 'invalidate'.

Page 4/13 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Session scoped bean as class attribute of Spring MVC Controller

    - by Sotirios Delimanolis
    I have a User class: @Component @Scope("session") public class User { private String username; } And a Controller class: @Controller public class UserManager { @Autowired private User user; @ModelAttribute("user") private User createUser() { return user; } @RequestMapping(value = "/user") public String getUser(HttpServletRequest request) { Random r = new Random(); user.setUsername(new Double(r.nextDouble()).toString()); request.getSession().invalidate(); request.getSession(true); return "user"; } } I invalidate the session so that the next time i got to /users, I get another user. I'm expecting a different user because of user's session scope, but I get the same user. I checked in debug mode and it is the same object id in memory. My bean is declared as so: <bean id="user" class="org.synchronica.domain.User"> <aop:scoped-proxy/> </bean> I'm new to spring, so I'm obviously doing something wrong. I want one instance of User for each session. How?

    Read the article

  • send and receive in socket [closed]

    - by user3696492
    I have trouble in sending an object through socket in c#, my client can send to server but server can't send to client, i think there is something wrong with the client. Server private void Form1_Load(object sender, EventArgs e) { CheckForIllegalCrossThreadCalls = false; Thread a = new Thread(connect); a.Start(); } private void sendButton_Click(object sender, EventArgs e) { client.Send(SerializeData(ShapeList[ShapeList.Count - 1])); } void connect() { try { server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); iep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 5555); server.Bind(iep); server.Listen(10); client = server.Accept(); while (true) { byte[] data = new byte[1024]; client.Receive(data); PaintObject a = (PaintObject)DeserializeData(data); ShapeList.Add(a); Invalidate(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } client private void Form1_Load(object sender, EventArgs e) { CheckForIllegalCrossThreadCalls = false; Thread a = new Thread(connect); a.Start(); } private void SendButton_Click(object sender, EventArgs e) { client.Send(SerializeData(ShapeList[ShapeList.Count - 1])); } void connect() { try { client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); iep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 5555); client.Connect(iep); while (true) { byte[] data = new byte[1024]; client.Receive(data); PaintObject a = (PaintObject)DeserializeData(data); ShapeList.Add(a); Invalidate(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }

    Read the article

  • Android - How to circular zoom/magnify part of image?

    - by IZI_Shadow_IZI
    I am trying to allow the user to touch the image and then basically a cirular magnifier will show that will allow the user to better select a certain area on the image. When the user releases the touch the magnified portion will dissapear. This is used on several photo editing apps and I am trying to implement my own version of it. The code I have below does magnify a circular portion of the imageview but does not delete or clear the zoom once I release my finger. I currently set a bitmap to a canvas using canvas = new Canvas(bitMap); and then set the imageview using takenPhoto.setImageBitmap(bitMap); I am not sure if I am going about it the right way. The onTouch code is below: zoomPos = new PointF(0,0); takenPhoto.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { int action = event.getAction(); switch (action) { case MotionEvent.ACTION_DOWN: zoomPos.x = event.getX(); zoomPos.y = event.getY(); matrix.reset(); matrix.postScale(2f, 2f, zoomPos.x, zoomPos.y); shader.setLocalMatrix(matrix); canvas.drawCircle(zoomPos.x, zoomPos.y, 20, shaderPaint); takenPhoto.invalidate(); break; case MotionEvent.ACTION_MOVE: zoomPos.x = event.getX(); zoomPos.y = event.getY(); matrix.reset(); matrix.postScale(2f, 2f, zoomPos.x, zoomPos.y); canvas.drawCircle(zoomPos.x, zoomPos.y, 20, shaderPaint); takenPhoto.invalidate(); break; case MotionEvent.ACTION_UP: //clear zoom here? break; case MotionEvent.ACTION_CANCEL: break; default: break; } return true; } });

    Read the article

  • How do I code a tree of objects in Haskell with pointers to parent and children?

    - by axilmar
    I've got the following problem: I have a tree of objects of different classes where an action in the child class invalidates the parent. In imperative languages, it is trivial to do. For example, in Java: public class A { private List<B> m_children = new LinkedList<B>(); private boolean m_valid = true; public void invalidate() { m_valid = false; } public void addChild(B child) { m_children.add(child); child.m_parent = this; } } public class B { public A m_parent = null; private int m_data = 0; public void setData(int data) { m_data = 0; m_parent.invalidate(); } } public class Main { public static void main(String[] args) { A a = new A(); B b = new B(); b.setData(0); //invalidates A } } How do I do the above in Haskell? I cannot wrap my mind around this, since once I construct an object in Haskell, it cannot be changed. I would be much obliged if the relevant Haskell code is posted.

    Read the article

  • NSTimer won't stop it only resets when invalidated & released

    - by J Fries
    When I press my stop button to stop the timer it just resets to the original time and begins counting down again. I have looked everywhere and all I have found is "invalidate" and it isn't working. I want the time to stop when I hit stop and the label to display the original time. I also turned off automatic counting so I could try releasing and it is giving me an error: 0x10e20a5: movl 16(%edx), %edx EXC_BAD_ACCESS (code=2, address=0x10) `NSTimer *rockettTimer; int rocketCount; @interface FirstViewController () @property (strong, nonatomic) IBOutlet UILabel *rocketTimer; - (IBAction)stopButton:(id)sender; - (IBAction)startButton:(id)sender; @end @implementation FirstViewController @synthesize rocketTimer; -(void) rocketTimerRun{ rocketCount = rocketCount - 1; int minuts = rocketCount / 60; int seconds = rocketCount - (minuts * 60); NSString *timerOutput = [NSString stringWithFormat:@"%d:%.2d", minuts, seconds]; rocketTimer.text = timerOutput; } - (IBAction)startButton:(id)sender { rocketCount = 180; rockettTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(rocketTimerRun) userInfo:nil repeats:YES]; - (IBAction)stopButton:(id)sender { [rockettTimer invalidate]; //[rockettTimer release]; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } - (void)viewDidUnload { [self setRocketTimer:nil]; [super viewDidUnload]; // Release any retained subviews of the main view. } - (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } else { return YES; } } @end`

    Read the article

  • ESXI Crash need help to understand log and support about nexentastor on virtual machine

    - by Bgnt44
    If i understand right, the following core dump means that the cpu4 has crashed the Host if i read the next line it seem that at the time the CPU 4 was assigned to the NexentaStore Vm ... SO if im right i can say that NexentaStor Vm crash my esxi Am i right ? Does that core dump can provide me some more informations ? 2012-11-14T03:48:01.046Z cpu4:6089)0x41221f25ba08:[0x41803007abff]PanicvPanicInt@vmkernel#nover+0x56 stack: 0x3000000008, 0x41221f25ba 2012-11-14T03:48:01.046Z cpu4:6089)0x41221f25bae8:[0x41803007b4a7]Panic@vmkernel#nover+0xae stack: 0x2e067c00000010, 0x0, 0x1f25bb38, 2012-11-14T03:48:01.047Z cpu4:6089)0x41221f25bc18:[0x4180300a7823]TLBDoInvalidate@vmkernel#nover+0x45a stack: 0xca, 0x0, 0x0, 0x0, 0x0 2012-11-14T03:48:01.047Z cpu4:6089)0x41221f25bc68:[0x418030489e17]UserMem_CartelFlush@<None>#<None>+0xce stack: 0xcaa0b, 0x0, 0x0, 0x4 2012-11-14T03:48:01.047Z cpu4:6089)0x41221f25bd78:[0x41803048ab91]UserMemUnmapStateCleanup@<None>#<None>+0x58 stack: 0x0, 0x41221f25bd 2012-11-14T03:48:01.047Z cpu4:6089)0x41221f25be58:[0x41803048b97d]UserMemUnmap@<None>#<None>+0x104 stack: 0x41221f267000, 0x41221f25bf 2012-11-14T03:48:01.048Z cpu4:6089)0x41221f25be98:[0x41803048bf20]UserMem_Unmap@<None>#<None>+0xe3 stack: 0x426, 0x0, 0x41221f25bef8, 2012-11-14T03:48:01.048Z cpu4:6089)0x41221f25beb8:[0x4180304a5985]UW64VMKSyscallUnpackReleasePhysMemMap@<None>#<None>+0x18 stack: 0x10 2012-11-14T03:48:01.048Z cpu4:6089)0x41221f25bef8:[0x418030476791]User_LinuxSyscallHandler@<None>#<None>+0x17c stack: 0x41803004cc70, 2012-11-14T03:48:01.048Z cpu4:6089)0x41221f25bf18:[0x4180300a82be]User_LinuxSyscallHandler@vmkernel#nover+0x19 stack: 0x3ffe63bed80, 0 2012-11-14T03:48:01.049Z cpu4:6089)0x41221f25bf28:[0x418030110064]gate_entry@vmkernel#nover+0x63 stack: 0x10b, 0x0, 0x0, 0x426, 0xcf76 2012-11-14T03:48:01.049Z cpu4:6089)VMware ESXi 5.1.0 [Releasebuild-799733 x86_64] PCPU 1 locked up. Failed to ack TLB invalidate (total of 1 locked up, PCPU(s): 1). 2012-11-14T03:48:01.050Z cpu4:6089)cr0=0x80010031 cr2=0xcaa0b750 cr3=0x197d7b000 cr4=0x42768 2012-11-14T03:48:01.050Z cpu4:6089)pcpu:0 world:6111 name:"vmm0:Windows_2012_-_SQL" (V) 2012-11-14T03:48:01.050Z cpu4:6089)pcpu:1 world:6032 name:"vmm0:Windows_2012_-_AD" (V) 2012-11-14T03:48:01.050Z cpu4:6089)pcpu:2 world:6098 name:"vmm0:Windows_2012_-_App" (V) 2012-11-14T03:48:01.050Z cpu4:6089)pcpu:3 world:4099 name:"idle3" (IS) 2012-11-14T03:48:01.050Z cpu4:6089)pcpu:4 world:6089 name:"vmx-vcpu-0:NexentaStor" (U) 2012-11-14T03:48:01.050Z cpu4:6089)pcpu:5 world:6134 name:"vmm0:Ubuntu_-_NGINX" (V) 2012-11-14T03:48:01.050Z cpu4:6089)pcpu:6 world:4102 name:"idle6" (IS) 2012-11-14T03:48:01.050Z cpu4:6089)pcpu:7 world:4103 name:"idle7" (IS) 2012-11-14T03:48:01.050Z cpu4:6089)@BlueScreen: PCPU 1 locked up. Failed to ack TLB invalidate (total of 1 locked up, PCPU(s): 1).

    Read the article

  • Hadoop and Object Reuse, Why?

    - by Andrew White
    In Hadoop, objects passed to reducers are reused. This is extremely surprising and hard to track down if you're not expecting it. Furthermore, the original tracker for this "feature" doesn't offer any evidence that this change actually improved performance (unless I missed it). It would speed up the system substantially if we reused the keys and values [...] but I think it is worth doing. This seems completely counter to this very popular answer. Is there some credence to the Hadoop developer's claim? Is there something "special" about Hadoop that would invalidate the notion of object creation being cheap?

    Read the article

  • Synchronizing local and remote cache in distributed caching

    - by ltfishie
    With a distributed cache, a subset of the cache is kept locally while the rest is held remotely. In a get operation, if the entry is not available locally, the remote cache will be used and and the entry is added to local cache. In a put operation, both the local cache and remote cache are updated. Other nodes in the cluster also need to be notified to invalidate their local cache as well. What's a simplest way to achieve this if you implemented it yourself, assuming that nodes are not aware of each other. Edit My current implementation goes like this: Each cache entry contains a time stamp. Put operation will update local cache and remote cache Get operation will try local cache then remote cache A background thread on each node will check remote cache periodically for each entry in local cache. If the timestamp on remote is newer overwrite the local. If entry is not found in remote, delete it from local.

    Read the article

  • How to remove items from an arraylist without shrinking the list [migrated]

    - by user73710
    I have a case where I am using the ArrayList to keep a list of items that are keyed by their position in the list. Other objects reference the ArrayList items by their position. If I delete one of the items from the list, I don't want the list to shrink because that would invalidate all other references to items in the list (e.g. item 2 is now in position 1). My solution to the shrinking array list problem is to null the position in the arraylist so that the list will not shrink. I am curious whether this will free the memory formerly held by the item at that position. If there is a better way to accomplish this requirement, I would like to know about it.

    Read the article

  • Android mapView ItemizedOverlay setFocus does not work properly

    - by Gaks
    Calling setFocus(null) on the ItemizedOverlay does not 'unfocus' current marker. According to the documentation: ... If the Item is not found, this is a no-op. You can also pass null to remove focus. Here's my code: MapItemizedOverlay public class MapItemizedOverlay extends ItemizedOverlay<OverlayItem> { private ArrayList<OverlayItem> items = new ArrayList<OverlayItem>(); public MapItemizedOverlay(Drawable defaultMarker) { super(defaultMarker); } public void addOverlay(OverlayItem overlay) { items.add(overlay); populate(); } @Override protected OverlayItem createItem(int i) { return items.get(i); } @Override public int size() { return items.size(); } } Creating map overlay and one marker: StateListDrawable youIcon = (StateListDrawable)getResources().getDrawable(R.drawable.marker_icon); int width = youIcon.getIntrinsicWidth(); int height = youIcon.getIntrinsicHeight(); youIcon.setBounds(-13, 0-height, -13+width, 0); GeoPoint location = new GeoPoint(40800816,-74122009); MapItemizedOverlay overlay = new MapItemizedOverlay(youIcon); OverlayItem item = new OverlayItem(location, "title", "snippet"); overlay.addOverlay(item); mapView.getOverlays().add(overlay); The R.drawable.marker_icon is defined as follows: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:drawable="@drawable/marker_selected" /> <item android:state_selected="true" android:drawable="@drawable/marker_selected" /> <item android:drawable="@drawable/marker_normal" /> </selector> Now, to test the setFocus() behavior I put the button on the activity window, with the following onClick listener: Button focusBtn = (Button)findViewById(R.id.focusbtn); focusBtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { for(Overlay ov : mapView.getOverlays()) { if(ov.getClass().getSimpleName().equals("MapItemizedOverlay") == true) { MapItemizedOverlay miv = (MapItemizedOverlay)ov; if(miv.getFocus() == null) miv.setFocus(miv.getItem(0)); else miv.setFocus(null); break; } } mapView.invalidate(); } }); The expected behavior is: clicking on the button toggles marker selection. It works only once - clicking it for the first time selects the marker, clicking it again does not de-select the marker. The most weird thing about it is that after calling setFocus(null), getFocus() also returns null - like the overlay has no focused item (I debugged it). But even after calling mapView.invalidate() the marker is still drawn in 'selected'(focused) state.

    Read the article

  • VS 2010 Profiling Problem with Signed Assemblies

    - by Binder
    I have a website that uses AjaxControlToolkit.dll and Log4Net.dll; When I try to run the performance profiling tool in VS 2010 on it it gives me the following warnings "AjaxControlToolkit.dll is signed and instrumenting it will invalidate its signature. If you proceed without a post-instrument event to re-sign the binary it may not load correctly". Now, if I choose the option to continue without re-signing the profiling starts but the assembly doesn't load and gives an ASP.NET exception.

    Read the article

  • VS 2010 Profiling Problem with Signed Assemblies

    - by Binder
    I have a website that uses AjaxControlToolkit.dll and Log4Net.dll; When I try to run the performance profiling tool in VS 2010 on it it gives me the following warnings "AjaxControlToolkit.dll is signed and instrumenting it will invalidate its signature. If you proceed without a post-instrument event to re-sign the binary it may not load correctly". Now, if I choose the option to continue without re-signing the profiling starts but the assembly doesn't load and gives an ASP.NET exception.

    Read the article

  • Cache invalidation between two web applications

    - by Muxa
    I need to invalidate cache in a web application when related data is updated in another application (running on the same machine). Both applications use the same database. I know there's SqlCacheDependency. How do is it in terms of performance? Is interprocess communication (e.g. using name pipes) an option in web applications? Does it outperform SqlCacheDependency?

    Read the article

  • logout with basic authentication without closing webbrowser like banking sites will display

    - by Satya
    hi, I need to come out of the application after some inactivity session I tried using session.invalidate(); but it is not working as i am using basic authentication and i redirected to JSP page where it asks for login again but it is not asking any login credentials directly logging in to application The only way to logout with basic authentication is to close the Webbrowser. I need an API such that after inactivty say 10 mins it should redirect to one JSP page without closing the browser like banking sites will display session expired please login again Thanks in advance, Satya

    Read the article

  • Panning weirdness on an UserControl

    - by Matías
    Hello, I'm trying to build my own "PictureBox like" control adding some functionalities. For example, I want to be able to pan over a big image by simply clicking and dragging with the mouse. The problem seems to be on my OnMouseMove method. If I use the following code I get the drag speed and precision I want, but of course, when I release the mouse button and try to drag again the image is restored to its original position. using System.Drawing; using System.Windows.Forms; namespace Testing { public partial class ScrollablePictureBox : UserControl { private Image image; private bool centerImage; public Image Image { get { return image; } set { image = value; Invalidate(); } } public bool CenterImage { get { return centerImage; } set { centerImage = value; Invalidate(); } } public ScrollablePictureBox() { InitializeComponent(); SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); Image = null; AutoScroll = true; AutoScrollMinSize = new Size(0, 0); } private Point clickPosition; private Point scrollPosition; protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); clickPosition.X = e.X; clickPosition.Y = e.Y; } protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (e.Button == MouseButtons.Left) { scrollPosition.X = clickPosition.X - e.X; scrollPosition.Y = clickPosition.Y - e.Y; AutoScrollPosition = scrollPosition; } } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); e.Graphics.FillRectangle(new Pen(BackColor).Brush, 0, 0, e.ClipRectangle.Width, e.ClipRectangle.Height); if (Image == null) return; int centeredX = AutoScrollPosition.X; int centeredY = AutoScrollPosition.Y; if (CenterImage) { //Something not relevant } AutoScrollMinSize = new Size(Image.Width, Image.Height); e.Graphics.DrawImage(Image, new RectangleF(centeredX, centeredY, Image.Width, Image.Height)); } } } But if I modify my OnMouseMove method to look like this: protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (e.Button == MouseButtons.Left) { scrollPosition.X += clickPosition.X - e.X; scrollPosition.Y += clickPosition.Y - e.Y; AutoScrollPosition = scrollPosition; } } ... you will see that the dragging is not smooth as before, and sometimes behaves weird (like with lag or something). What am I doing wrong? I've also tried removing all "base" calls on a desperate movement to solve this issue, haha, but again, it didn't work. Thanks for your time.

    Read the article

  • Caching web API proxy?

    - by Jeremy Dunck
    I was wondering if anyone knows of a caching proxy specifically for dealing with API responses? Ideally, I'd be able to declare what caching policy to use for different API semantics, e.g. cache album art for 1 day, cache favorite tweets for 5 minutes, cache map tiles forever, except invalidate when this other API is called. I know about using Apache, Squid, etc for caching in general -- I'm just hoping for something with nicer usage semantics by restricting the design goal to dealing with APIs rather than the web in general.

    Read the article

  • A way to remove selected LineShape shadow effect?

    - by serhio
    Is there a way to remove the LineShape shadow effect when selecting the lineShape? I tried Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs) Dim g As Graphics = e.Graphics g.SmoothingMode = SmoothingMode.AntiAlias Dim oldmode As SmoothingMode = g.SmoothingMode g.DrawLine(_Pen, X1, Y1, X2, Y2) g.SmoothingMode = oldmode End Sub but finally, this have some back effects on invalidation: when moving (in a panel) the line leave traces - does not invalidate properly.

    Read the article

  • NSTimer as a self-targeting ivar.

    - by Matt Wilding
    I have come across an awkward situation where I would like to have a class with an NSTimer instance variable that repeatedly calls a method of the class as long as the class is alive. For illustration purposes, it might look like this: // .h @interface MyClock : NSObject { NSTimer* _myTimer; } - (void)timerTick; @end - // .m @implementation MyClock - (id)init { self = [super init]; if (self) { _myTimer = [[NSTimer scheduledTimerWithTimeInterval:1.0f target:self selector:@selector(timerTick) userInfo:nil repeats:NO] retain]; } return self; } - (void)dealloc { [_myTimer invalidate]; [_myTImer release]; [super dealloc]; } - (void)timerTick { // Do something fantastic. } @end That's what I want. I don't want to to have to expose an interface on my class to start and stop the internal timer, I just want it to run while the class exists. Seems simple enough. But the problem is that NSTimer retains its target. That means that as long as that timer is active, it is keeping the class from being dealloc'd by normal memory management methods because the timer has retained it. Manually adjusting the retain count is out of the question. This behavior of NSTimer seems like it would make it difficult to ever have a repeating timer as an ivar, because I can't think of a time when an ivar should retain its owning class. This leaves me with the unpleasant duty of coming up with some method of providing an interface on MyClock that allows users of the class to control when the timer is started and stopped. Besides adding unneeded complexity, this is annoying because having one owner of an instance of the class invalidate the timer could step on the toes of another owner who is counting on it to keep running. I could implement my own pseudo-retain-count-system for keeping the timer running but, ...seriously? This is way to much work for such a simple concept. Any solution I can think of feels hacky. I ended up writing a wrapper for NSTimer that behaves exactly like a normal NSTimer, but doesn't retain its target. I don't like it, and I would appreciate any insight.

    Read the article

  • CDI SessionScoped Bean instance remains unchanged when login with different user

    - by Jason Yang
    I've been looking for the workaround of this problem for rather plenty of time and no result, so I ask question here. Simply speaking, I'm using a CDI SessionScoped Bean User in my project to manage user information and display them on jsf pages. Also container-managed j_security_check is used to resolve authentication issue. Everything is fine if first logout with session.invalidate() and then login in the same browser tab with a different user. But when I tried to directly login (through login.jsf) with a new user without logout beforehand, I found the user information remaining unchanged. I debugged and found the User bean, as well as the HttpSession instance, always remaining the same if login with different users in the same browser, as long as session.invalidate() not invoked. But oddly, the session id did modified, and I've both checked in Java code and Firebug. org.apache.catalina.session.StandardSessionFacade@5d7b4092 StandardSession[c69a71d19f369d08b5dddbea2ef0] attrName = org.jboss.weld.context.conversation.ConversationIdGenerator : attrValue=org.jboss.weld.context.conversation.ConversationIdGenerator@583c9dd8 attrName = org.jboss.weld.context.ConversationContext.conversations : attrValue = {} attrName = org.jboss.weld.context.http.HttpSessionContext#org.jboss.weld.bean-Discipline-ManagedBean-class com.netease.qa.discipline.profile.User : attrValue = Bean: Managed Bean [class com.netease.qa.discipline.profile.User] with qualifiers [@Any @Default @Named]; Instance: com.netease.qa.discipline.profile.User@c497c7c; CreationalContext: org.jboss.weld.context.CreationalContextImpl@739efd29 attrName = javax.faces.request.charset : attrValue = UTF-8 org.apache.catalina.session.StandardSessionFacade@5d7b4092 StandardSession[c6ab4b0c51ee0a649ef696faef75] attrName = org.jboss.weld.context.conversation.ConversationIdGenerator : attrValue = org.jboss.weld.context.conversation.ConversationIdGenerator@583c9dd8 attrName = com.sun.faces.renderkit.ServerSideStateHelper.LogicalViewMap : attrValue = {-4968076393130137442={-7694826198761889564=[Ljava.lang.Object;@43ff5d6c}} attrName = org.jboss.weld.context.ConversationContext.conversations : attrValue = {} attrName = org.jboss.weld.context.http.HttpSessionContext#org.jboss.weld.bean-Discipline-ManagedBean-class com.netease.qa.discipline.profile.User : attrValue = Bean: Managed Bean [class com.netease.qa.discipline.profile.User] with qualifiers [@Any @Default @Named]; Instance: com.netease.qa.discipline.profile.User@c497c7c; CreationalContext: org.jboss.weld.context.CreationalContextImpl@739efd29 attrName = javax.faces.request.charset : attrValue = UTF-8 Above block contains two successive logins and their Session info. We can see that the instance(1st row) the same while session id(2nd row) different. Seems that session object is reused to contain different session id and CDI framework manages session bean life cycle in accordance with the session object only(?). I'm wondering whether there could be only one server-side session object within the same browser unless invalidated? Since I'm adopting j_security_check I fancy intercepting it and invalidating old session is not so easy. So is it possible to accomplish the goal without altering the CDI+JSF+j_security_check design that one can relogin with different account in the same or different tab within the same browser? Really look forward for your response. More info: Glassfish v3.1 is my appserver.

    Read the article

  • Is it a good way to close a thread?

    - by Roman
    I have a short version of the question: I start a thread like that: counter.start();, where counter is a thread. At the point when I want to stop the thread I do that: counter.interrupt() In my thread I periodically do this check: Thread.interrupted(). If it gives true I return from the thread and, as a consequence, it stops. And here are some details, if needed: If you need more details, they are here. From the invent dispatch thread I start a counter thread in this way: public static void start() { SwingUtilities.invokeLater(new Runnable() { public void run() { showGUI(); counter.start(); } }); } where the thread is defined like that: public static Thread counter = new Thread() { public void run() { for (int i=4; i>0; i=i-1) { updateGUI(i,label); try {Thread.sleep(1000);} catch(InterruptedException e) {}; } // The time for the partner selection is over. SwingUtilities.invokeLater(new Runnable() { public void run() { frame.remove(partnerSelectionPanel); frame.add(selectionFinishedPanel); frame.invalidate(); frame.validate(); } }); } }; The thread performs countdown in the "first" window (it shows home much time left). If time limit is over, the thread close the "first" window and generate a new one. I want to modify my thread in the following way: public static Thread counter = new Thread() { public void run() { for (int i=4; i>0; i=i-1) { if (!Thread.interrupted()) { updateGUI(i,label); } else { return; } try {Thread.sleep(1000);} catch(InterruptedException e) {}; } // The time for the partner selection is over. if (!Thread.interrupted()) { SwingUtilities.invokeLater(new Runnable() { public void run() { frame.remove(partnerSelectionPanel); frame.add(selectionFinishedPanel); frame.invalidate(); frame.validate(); } }); } else { return; } } };

    Read the article

  • Comet and [Session] TimeOut

    - by Amitd
    hi guys, Just Wondering how [session] timeouts are(or can be) implemented when using Comet? I'm using Long polling Comet solution and want to implement a kind of Timeout feature. Example : If the user is on a comet enabled page and doesn't respond to server events/notification for a period of time say 10 mins then invalidate his session and remove his request from server and redirect the user to a timeout page? Will this require Javascript XHR requests to check for a timeout explictly? Using ASP.NET 3.5 / C# Thanks

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >