Search Results

Search found 17151 results on 687 pages for 'event driven'.

Page 40/687 | < Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >

  • Message Driven Bean with Java Message Queue down

    - by Rafa de Castro
    I have the following problem deploying my application. It uses JMS and a remote openMQ for communication between servers. The problem is that the connection is not fully reliable so it can be up or down. For reconnecting I set the jms reconnect glassfish property so it reconnects if at some moment the connection gets lost. The problem arises when i try to deploy the application and there is no connection. It looks like it keeps retrying the connection but the application does not finish deployment until connection is available. Is it possible to configure it in any way that the deployment continues even if there is no connection and keeps retrying until there is connection available? Thanks a lot.

    Read the article

  • Should an Event that has no arguments define its own custom EventArgs or simply use System.EventArgs

    - by Mike Rosenblum
    I have an event that is currently defined with no event arguments. That is, the EventArgs it sends is EventArgs.Empty. In this case, it is simplest to declare my Event handler as: EventHandler<System.EventArgs> MyCustomEvent; I do not plan on adding any event arguments to this event, but it is possible that any code could need to change in the future. Therefore, I am leaning towards having all my events always create an empty event args type that inheretis from System.EventArgs, even if there are no event args currently needed. Something like this: public class MyCustomEventArgs : EventArgs { } And then my event definition becomes the following: EventHandler<MyCustomEventArgs> MyCustomEvent; So my question is this: is it better to define my own MyCustomEventArgs, even if it does not add anything beyond inheriting from System.EventArgs, so that event arguments could be added in the future more easily? Or is it better to explicitly define my event as returning System.EventArgs, so that it is clearer to the user that there are no extra event args? I am leaning towards creating custom event arguments for all my events, even if the event arguments are empty. But I was wondering if others thought that making it clearer to the user that the event arguments are empty would be better? Much thanks in advance, Mike

    Read the article

  • Service Oriented Architecture & Domain-Driven Design

    - by Michael
    I've always developed code in a SOA type of way. This year I've been trying to do more DDD but I keep getting the feeling that I'm not getting it. At work our systems are load balanced and designed not to have state. The architecture is: Website ===Physical Layer== Main Service ==Physical Layer== Server 1/Service 2/Service 3/Service 4 Only Server 1,Service 2,Service 3 and Service 4 can talk to the database and the Main Service calls the correct service based on products ordered. Every physical layer is load balanced too. Now when I develop a new service, I try to think DDD in that service even though it doesn't really feel like it fits. I use good DDD principles like entities, value types, repositories, aggregates, factories and etc. I've even tried using ORM's but they just don't seem like they fit in a stateless architecture. I know there are ways around it, for example use IStatelessSession instead of ISession with NHibernate. However, ORM just feel like they don't fit in a stateless architecture. I've noticed I really only use some of the concepts and patterns DDD has taught me but the overall architecture is still SOA. I am starting to think DDD doesn't fit in large systems but I do think some of the patterns and concepts do fit in large systems. Like I said, maybe I'm just not grasping DDD or maybe I'm over analyzing my designs? Maybe by using the patterns and concepts DDD has taught me I am using DDD? Not sure if there is really a question to this post but more of thoughts I've had when trying to figure out where DDD fits in overall systems and how scalable it truly is. The truth is, I don't think I really even know what DDD is?

    Read the article

  • The Community-Driven GDB Primer

    - by fbrereto
    I was reading this question and realized it might be helpful for entry- and pro-level developers alike (including myself) to have a common reference for best practices in using gdb. Many questions asked on Stack Overflow could easily be solved by taking some time to step some code in a debugger, and it would be good to have a community-approved resource to "teach them how to fish", so to speak. Even for those seasoned veterans who occasionally find themselves in gdb when they are accustomed to a GUI-tastic debugger might benefit from those who are much more familiar with the command line tool. For starters (both to gdb and to prime this thread) I submit: Ninefinger's gdb primer The gdb quick reference guide, which is useful for telling you what commands are available but not how best to use them. My hope is this thread is a seed planted that is of continued value to the community. If by "continued value" the community decides to nix it altogether, well then the masses have spoken.

    Read the article

  • Is android's motion event handling accurate??

    - by Peterdk
    Bug I have a weird bug in my piano app. Sometimes keys (and thus notes) hang. I did a lot of debugging and narrowed it down to what looks like androids inaccuracy of motion event handling: DEBUG/(2091): ACTION_DOWN A4 DEBUG/(2091): KeyDown: A4 DEBUG/(2091): ACTION_MOVE A4 => A4 DEBUG/(2091): ACTION_MOVE ignoring DEBUG/(2091): ACTION_MOVE A4 => A4 DEBUG/(2091): ACTION_MOVE ignoring DEBUG/(2091): ACTION_MOVE A4 => A4 DEBUG/(2091): ACTION_MOVE ignoring DEBUG/(2091): ACTION_UP B4 //HOW CAN THIS BE???? DEBUG/(2091): KeyUp: B4 DEBUG/(2091): Stream is null, can't stop DEBUG/(2091): Hanging Note: A4 X=240-287 EventX=292 Y=117-200 EventY=164 DEBUG/(2091): KeyUp Note: B4 X=288-335 EventX=292 Y=117-200 EventY=164 Clearly it can be seen here that out of nowhere I suddenly have an ACTION_UP for another note. Shouldn't I definitely get a ACTION_MOVE first? As shown in the end of the log, it's definitely not an error in region detection, since the ACTION_UP event is clearly in the B4 region. Logging Implementation details Every onTouchEvent() call is logged, so the log is accurate. The relevant pseudo-code for the ACTION_MOVE logging is: Key oldKey = Key.get(event.getHistoricalX(), event.getHistoricalY()); Key newKey = Key.get(event.getX(), event.getY()); Question Is this normal behaviour for Android (the jumping in coordinates)? Am I missing something?

    Read the article

  • Domain driven design value object, how to ensure a unique value

    - by Darren
    Hi, I am building a questionnaire creator. A questionnaire consists of sections, sections consist of pages and pages consist of questions. Questionnaire is the aggregate root. Sections, pages and questions can have what are called shortcodes which should be unique within a questionnaire (but not unique within the database hence they are not strictly an identity). I intended to make the shortcode a value object and wanted to include the business rule that it should be unique within the questionnaire but I am unsure how to ensure that. My understanding is that the value object should not access the repository or service layer so how does it find out if it is unique? Thanks for any help. Darren

    Read the article

  • Test Driven Development For Complex Methods involving external dependency

    - by bill_tx
    I am implementing a Service Contract for WCF Service. As per TDD I wrote a test case to just pass it using hardcoded values. After that I started to put real logic into my Service implementation. The actual logic relies on 3-4 external service and database. What should I do to my original test case that I wrote ? If i Keep it same in order to make test pass it will have to call several other external services. So I have question in general what should I do if I write a test case for a Business Facade first using TDD and later when I add real logic, if it involves external dependency.

    Read the article

  • Too Many Public Methods Forced by Test Driven Development

    - by RoryG
    A very specific question from a novice to TDD: I seperate my tests and my app into different packages. Thus, most of my app methods have to be public for tests to access them. As I progress, it becomes obvious that some methods could become private, but if I make that change, the tests that access them won't work. Am I missing a step, or doing something wrong, or is this just one downfall of TDD?

    Read the article

  • Implementing a Stack using Test-Driven Development

    - by devoured elysium
    I am doing my first steps with TDD. The problem is (as probably with everyone starting with TDD), I never know very well what kind of unit tests to do when I start working in my projects. Let's assume I want to write a Stack class with the following methods(I choose it as it's an easy example): Stack<T> - Push(element : T) - Pop() : T - Seek() : T - Count : int - IsEmpty : boolean How would you approch this? I never understood if the idea is to test a few corner cases for each method of the Stack class or start by doing a few "use cases" with the class, like adding 10 elements and removing them. What is the idea? To make code that uses the Stack as close as possible to what I'll use in my real code? Or just make simple "add one element" unit tests where I test if IsEmpty and Count were changed by adding that element? How am I supposed to start with this?

    Read the article

  • ASP.NET Event delegation between user controls

    - by Ishan
    Give the following control hierarchy on a ASP.NET page: Page HeaderControl       (User Control) TitleControl       (Server Control) TabsControl       (User Control) other controls I'm trying to raise an event (or some notification) in the TitleControl that bubbles to the Page level. Then, I'd like to (optionally) register an event handler at the Page codebehind that will take the EventArgs and modify the TabsControl in the example above. The important thing to note is that this design will allow me to drop these controls into any Page and make the entire system work seamlessly if the event handler is wired up. The solution should not involve a call to FindControl() since that becomes a strong association. If no handler is defined in the containing Page, the event is still raised by TitleControl but is not handled. My basic goal is to use event-based programming so that I can decouple the user controls from each other. The event from TitleControl is only raised in some instances, and this seemed to be (in my head) the preferred approach. However, I can't seem to find a way to cleanly achieve this. Here are my (poor) attempts: Using HttpContext.Current.Items Add the EventArgs to the Items collection on TitleControl and pick it up on the TabsControl. This works but it's fundamentally hard to decipher since the connection between the two controls is not obvious. Using Reflection Instead of passing events, look for a function on the container Page directly within TitleControl as in: Page.GetType().GetMethod("TabControlHandler").Invoke(Page, EventArgs); This will work, but the method name will have to be a constant that all Page instances will have to defined verbatim. I'm sure that I'm over-thinking this and there must be a prettier solution using delegation, but I can't seem to think of it. Any thoughts?

    Read the article

  • What is model driven development good for?

    - by happyappa
    Microsoft, of Cairo fame, is working on Oslo, a new modeling platform. Bob Muglia, Senior Vice President of Microsoft Server & Tools Business, states that the benefits of modeling have always been clear. In simple, practical terms, what are the clear benefits that Oslo bestows upon its users?

    Read the article

  • Following Domain Driven Design with MVVM/WPF

    - by msfanboy
    Hello, I have plain POCOs here and as INotifyPropertyChanged is a Interface for the Views need its implemented in the ViewModel not the Model. Now I want to show validation errors in the View beside every textbox the user typed in data. I do not want to implemented the IDataErrorInfo interface in my Models because lets assume I am not allowed to touch them as they come from another Service/Supplier. I do not want to put my IsCustomerFirstNameLenthValid Method into the Model because I could not have access to it or I just dont want to pollute my Models with interface`s having nothing to do there! How can I validate my naked POCO`s in the ViewModel and forward the results to the View by showing validation errors ?

    Read the article

  • Can we have ExtJs components inside a Flex driven page

    - by shafi
    Hi, I am working on a page which mainly consists of Charts and Grids. Thought that Flex would be the best fit with some cool effects. But however, I now feel that ExtJs grid looks better than Flex data grid. My question is whether there is any possibility / mechanism to embed Ext JS grid into a Flex page. Lets say my main page has a Flex tab panel. In first tab, I would like to see 'Flex Chart' and in second tab I would want to see 'ExtJS grid'. I would also want to know of any Flex Data grid plugin (if exists), which looks/works just like Ext Js grid. Thanks & Regards Shafi

    Read the article

  • Creating a data driven web front end quickly

    - by Ilya
    Over the last few years, I can't count how many web front ends I've had to create over a relatively simple database schema to fasciliate data entry. I have to imagine that someone out there has written a framework I can use to simplify the creation of these kind of simple GUIs. Doing a quick google, the following look like the key players in .net: ASP.Net dynamic data framework SubSonic NakedObjects for .net Has anyone worked with any of these and have any preferences? More importantly, are there other frameworks that would be good to evaluate in this space?

    Read the article

  • WPF, notify a child in the element tree about an event in a parent

    - by jester
    I am developing a WPF app and I want an event in a parent to be notified to several of its children in the element tree, so that each of them can take an action accordingly. I know that a custom RoutedEvent can be used to signal in the other direction from a child to one of its ancestors by bubbling the event upwards, so that any of the ancestor elements can handle the event. What I want is the children to be notified about an event in the parent and they handle them appropriately. What is the best strategy to achieve this? EDIT: Clarifying the comments : Say I have a parent UserControl. It has a TabControl and its contents are several nested child UserControls. Now consider a scenario where I want the TabControl.SelectionChanged() event to cause some changes in each of the child UserControl. How to achieve this? (The contents of each tab is a UserControl which themselves may contain another few levels of children UserControls. I want the UserControl in the bottom level to know about the SelectionChanged() event and respond accordingly).

    Read the article

  • jQuery-driven app. won't work without alert()

    - by webjawns.com
    I have seen a lot of articles on this, but none dealing with jQuery, so here I go... I am implementing a version of a script from http://javascript-array.com/scripts/jquery_simple_drop_down_menu/ into an existing application; however, I cannot get it to work without adding alert('msg...') as the first method within the $(document).ready() call. This has nothing to do with load time... no matter how long I wait, the menu does not work. Add alert(), however, and it works like a charm. var timeout = 500; var closetimer = 0; var ddmenuitem = 0; function jsddm_open() { jsddm_canceltimer(); jsddm_close(); ddmenuitem = $(this).find('ul').css('visibility', 'visible');} function jsddm_close() { if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');} function jsddm_timer() { closetimer = window.setTimeout(jsddm_close, timeout);} function jsddm_canceltimer() { if(closetimer) { window.clearTimeout(closetimer); closetimer = null;}} $(document).ready(function() { $('#jsddm > li').bind('mouseover', jsddm_open) $('#jsddm > li').bind('mouseout', jsddm_timer)}); document.onclick = jsddm_close;

    Read the article

  • NHibernate listener/event to replace object before insert/update

    - by vIceBerg
    Hi! I have a Company class which have a collection of Address. Here's my Address class:(written top of my head): public class Address { public string Civic; public string Street; public City City; } This is the City class: public class City { public int Id; public string Name; public string SearchableName{ get { //code } } } Address is persisted in his own table and have a reference to the city's ID. City are also persisted in is own table. The City's SearchableName is used to prevent some mistakes in the city the user type. For example, if the city name is "Montréal", the searchable name will be "montreal". If the city name is "St. John", the searchable name will be "stjohn", etc. It's used mainly to to search and to prevent having multiple cities with a typo in it. When I save an address, I want an listener/event to check if the city is already in the database. If so, cancel the insert and replace the user's city with the database one. I would like the same behavior with updates. I tried this: public bool OnPreInsert(PreInsertEvent @event) { City entity = (@event.Entity as City); if (entity != null) { if (entity.Id == 0) { var city = (from c in @event.Session.Linq<City>() where c.SearchableName == entity.SearchableName select c).SingleOrDefault(); if (city != null) { //don't know what to do here return true; } } } return false; } But if there's already a City in the database, I don't know what to do. @event.Entity is readonly, if I set @event.Entity.Id, I get an "null identifier" exception. I tried to trap insert/update on Address and on Company, but the City if the first one to get inserted (it's logic...) Any thoughts? Thanks

    Read the article

  • Excel automation: Close event missing

    - by chiccodoro
    Another hi all, I am doing Excel automation via Interop in C#, and I want to be informed when a workbook is closed. However, there is no Close event on the workbook nor a Quit event on the application. Has anybody done that before? How can I write a piece of code which reacts to the workbook being closed (which is only executed if the workbook is really closed)? Ideally that should happen after closing the workbook, so I can rely on the file to reflect all changes. Details about what I found so far: There is a BeforeClose() event, but if there are unsaved changes this event is raised before the user being asked whether to save them, so at the moment I can process the event, I don't have the final file and I cannot release the COM objects, both things that I need to have/do. I do not even know whether the workbook will actually be closed, since the user might choose to abort closing. Then there is a BeforeSave() event. So, if the user chooses "Yes" to save unsaved changes, then BeforeSave() is executed after BeforeClose(). However, if the user chooses to "Abort", then hits "file-save", the exact same order of events is executed. Further, if the user chooses "No", the BeforeSave() isn't executed at all. The same holds as long as the user doesn't click any of these options.

    Read the article

  • NSFetchedResultsController not processing certain section driven moves

    - by JK
    I utilize a NSFetchedResultsController (frc) with a Core Data store. I implement all the frc delegate methods. The table is sporadically updated by background threads. All the inserts, deletes and updates work fine, with the exception that updates to the frc's index key for rows toward to the bottom of the table (50 rows), do not result in a section move. e.g. if "name" is the index key and the name "Victor" is changed to "Alex", the victor row now shows the name Alex, but is not moved to the top of the table alongside all other names starting with A. As I noted, this is only for rows towards the bottom of the table. If a row like "Andy" is changed to "Ben", the move is indeed processed correctly by the frc. Any suggestions to fix this would be appreciated. I do not use a frc cache. Thanks

    Read the article

  • .NET: How to pass value when subscribing to event and obtain it when the event is triggered (Dynamic

    - by Entrase
    The task is to create event handlers in runtime. I need the one method to be called with different parameter value for different events. The events and their number are only known in runtime. So I'm trying to generate dynamic methods, each of which will be assigned to some event, but in general they all just pass some value to an instance method and call it. It would be great if something similar could be done the easier way. I mean passing some value at subscribing stage and then obtaining it when the event is triggered. This is what I'm trying to do now: public class EventSource { public event EventHandler eventOne; public event EventHandler eventTwO; public event EventHandler eventThree; } public class EventListener { SubscribeForEvents() { BindingFlags flags = BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance; // Suppose we've already got EventInfo // and target source somewhere // so we can do eventInfo.AddEventHandler(target, delegate) // Now we need a delegate. int value = 42; Type tDelegate = eventInfo.EventHandlerType; // http://msdn.microsoft.com/en-us/library/ms228976(VS.95).aspx Type returnType = GetDelegateReturnType(tDelegate); DynamicMethod listener = new DynamicMethod("", null, GetDelegateParameterTypes(tDelegate), this.GetType()); ///////// Type[] callParameters = { typeof(int) }; MethodInfo method = this.GetType().GetMethod("ToCallFromDelegate", flags); ILGenerator generator = listener.GetILGenerator(); // No success in this mess. What's wrong? generator.Emit(OpCodes.Ldc_I4, value); generator.Emit(OpCodes.Call, method); generator.Emit(OpCodes.Pop); generator.Emit(OpCodes.Ret); ///////////// Delegate delegate = listener.CreateDelegate(tDelegate); eventInfo.AddEventHandler(target, delegate); // When triggered, there is InvalidProgramException } void ToCallFromDelegate(int value) { doSomething(); } }

    Read the article

  • Message driven bean not responding until client method is complete

    - by poijoi
    Hi, I have a MDB deployed on Jboss 4.2.2 and a client on the same server that produces messages and expects a reply from the MDB via a temporary queue created before the message is sent. When I run the client, I see that it creates the message, puts it in the queue and waits for the reply (no problem so far) ... but when I check in the logs I see that the timeout is reached and no response is received. When the timeout occurs and the client's method is complete the MDB starts processing the message that should have been processed the moment the client put it in the queue. As a consequence of this timing issue, when the MDB tries to reply to the temp queue, it fails since the client is already gone. If I run the same client from a remote server, I have no problem... The MDB picks up the message from the queue right away and the client receives its response right after the processing is complete. I'm using container managed transactions. I suspect it has something to do with that... I think the client's "send message/receive reply" might be all be considered a transaction before it commits to put the message in the queue... but I'm not sure if this is correct. If this is the case, why did I not see the same behavior from the remote client? is client managed transaction the default setting and that's what my remote server was using? Any idea how to fix this? Thanks in advance! PJ

    Read the article

  • Assign click event to addon icon on navigation bar

    - by Charsee
    We have created a chrome extension for our app. Where we call a METHOD from a "js file" on CLICK event of the "extension icon" placed on the navigation bar. For this we use message passing between the app.js (file containing the METHOD to be called on icon click) and background.html (using a js file included in this html). The script used to pass message is:(from background.html) chrome.browserAction.onClicked.addListener(function (tab) { chrome.tabs.sendMessage(tab.id, "showPopup"); }); and to listen the message :(in app.js) chrome.extension.onMessage.addListener(function(request) { if (request === "showPopup") { showPopup(); } }); The click event works as expected. But now we want to do same thing in mozilla extension. and we can't pass message to app.js on the click of the icon,so that it can execute the containing methods. We have also added the app.js using pageMod, something like this exports.main = function(options, callbacks) { pageMod.PageMod({ include: ["*"], contentScriptWhen: 'start', contentScriptFile: [data.url('jquery-1.7.1.min.js'),data.url('app.js')] }); createAndAddNavBarButton(); }; function createAndAddNavBarButton() { var navBar = document.getElementById('nav-bar');//assume document has been defined if (!navBar){return;}; var nbBtn = document.createElement('navbaricon'); nbBtn.setAttribute('id', 'navButton'); nbBtn.setAttribute('image', data.url('icon_16.png')); nbBtn.onclick = function(){ showPopup(); return true; } navBar.appendChild(btn); } But the click event does nothing and showPopup() is undefined. When a new page loads event associated with it in the app.js executes without any error but the click event doesn't work. Is there a method from where we can assign click event directly to this icon, as we have done in the case of chrome extension.

    Read the article

  • PHP driven site needs password change.

    - by Drea
    I have inherited a website that needs the password changed that accesses the database. I can see that there are two tables within the database but neither of them have username or password info. The previous web guy moved out of the country and can't be reached. I am not up-to-speed enough to figure this out. I have gone through all the files to try and find the answer but can't get it. It's hosted by goDaddy.com and I have changed the passwords there but it didn't change this login info. www.executivehomerents.com/cpanel <-this brings up the prompt for the username & password which I won't give out but the page only gives you 5 choices and none of them deal with changing the password. They are simply to change the data in the tables. If you go to: http://www.websitedatabases.com/ <=this is the company that the PHPMagic program was purchased from-- They have no contact number. Here is another page that might help: http://www.executivehomerents.com/cpanel/dbinput/setup.php I don't think I'll get an answer to this but it's worth a try... thanks.

    Read the article

  • Patterns for dynamic CMS components (event driven?)

    - by CitrusTree
    Sorry my title is not great, this is my first real punt at moving 100% to OO as I've been procedural for more years than I can remember. I'm finding it hard to understand if what I'm trying to do is possible. Depending on people's thoughts on the 2 following points, I'll go down that route. The CMS I'm putting together is quote small, however focuses very much on different types of content. I could easily use Drupal which I'm very comfortable with, but I want to give myself a really good reasons to move myself into design patterns / OO-PHP 1) I have created a base 'content' class which I wish to be able to extend to handle different types of content. The base class, for example, handles HTML content, and extensions might handle XML or PDF output instead. On the other hand, at some point I may wish to extend the base class for a given project completely. I.e. if class 'content-v2' extended class 'content' for that site, any calls to that class should actually call 'content-v2' instead. Is that possible? If the code instantiates an object of type 'content' - I actually want it to instantiate one of type 'content-v2'... I can see how to do it using inheritance, but that appears to involve referring to the class explicitly, I can't see how to link the class I want it to use instead dynamically. 2) Secondly, the way I'm building this at the moment is horrible, I'm not happy with it. It feels very linear indeed - i.e. get session details get content build navigation theme page publish. To do this all the objects are called 1-by-1 which is all very static. I'd like it to be more dynamic so that I can add to it at a later date (very closely related to first question). Is there a way that instead of my orchestrator class calling all the other classes 1-by-1, then building the whole thing up at the end, that instead each of the other classes can 'listen' for specific events, then at the applicable point jump in and do their but? That way the orchestrator class would not need to know what other classes were required, and call them 1-by-1. Sorry if I've got this all twisted in my head. I'm trying to build this so it's really flexible.

    Read the article

< Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >